Fix '*' or name database in tisbackup gui

This commit is contained in:
ssamson-tis 2015-10-27 15:23:45 +01:00
parent e8708f1efa
commit af9471e56b

View File

@ -92,7 +92,7 @@ def read_config():
for backup_item in backup.backup_list: for backup_item in backup.backup_list:
if backup_item.backup_name in backup_sections: if backup_item.backup_name in backup_sections:
b = {} b = {}
for attrib_name in backup_item.required_params+backup_item.required_params: for attrib_name in backup_item.required_params+backup_item.optional_params:
if hasattr(backup_item,attrib_name): if hasattr(backup_item,attrib_name):
b[attrib_name] = getattr(backup_item,attrib_name) b[attrib_name] = getattr(backup_item,attrib_name)
result.append(b) result.append(b)
@ -126,12 +126,12 @@ def read_config():
backup_dict['rsync_list'].append([server_name, backup_name, backup_type,remote_dir]) backup_dict['rsync_list'].append([server_name, backup_name, backup_type,remote_dir])
if backup_type == "null": if backup_type == "null":
backup_dict['null_list'].append([server_name, backup_name, backup_type, ""]) backup_dict['null_list'].append([server_name, backup_name, backup_type, ""])
if backup_type == "pgsql+ssh": if backup_type == "pgsql+ssh":
db_name = row['db_name'] db_name = row['db_name'] if len(row['db_name']) > 0 else '*'
backup_dict['pgsql_list'].append([server_name, backup_name, backup_type, db_name]) backup_dict['pgsql_list'].append([server_name, backup_name, backup_type, db_name])
if backup_type == "mysql+ssh": if backup_type == "mysql+ssh":
db_name = row.get('db_name', '*') db_name = row['db_name'] if len(row['db_name']) > 0 else '*'
backup_dict['mysql_list'].append([server_name, backup_name, backup_type, db_name]) backup_dict['mysql_list'].append([server_name, backup_name, backup_type, db_name])
if backup_type == "sqlserver+ssh": if backup_type == "sqlserver+ssh":
db_name = row['db_name'] db_name = row['db_name']
backup_dict['sqlserver_list'].append([server_name, backup_name, backup_type, db_name]) backup_dict['sqlserver_list'].append([server_name, backup_name, backup_type, db_name])