fix: Added base verbosity for success/failure in backup command

This commit is contained in:
Gavin D'souza 2020-09-07 20:37:55 +05:30
parent 1c130308e6
commit cfe4fe5fcf

View file

@ -404,9 +404,9 @@ def backup(context, with_files=False, backup_path=None, backup_path_db=None, bac
frappe.init(site=site)
frappe.connect()
odb = scheduled_backup(ignore_files=not with_files, backup_path=backup_path, backup_path_db=backup_path_db, backup_path_files=backup_path_files, backup_path_private_files=backup_path_private_files, backup_path_conf=backup_path_conf, force=True, verbose=verbose, compress=compress)
except Exception as e:
except Exception:
if verbose:
print("Backup failed for {0}. Database or site_config.json may be corrupted".format(site))
click.echo("Backup failed for Site {0}. Database or site_config.json may be corrupted".format(site), fg="red")
exit_code = 1
continue
@ -418,6 +418,8 @@ def backup(context, with_files=False, backup_path=None, backup_path_db=None, bac
if with_files:
print("Public file: {0}\nPrivate file: {1}".format(odb.backup_path_files, odb.backup_path_private_files))
click.echo("Backup for Site {0} has been successfully completed{1}".format(site, " with files" if with_files else ""), fg="green")
frappe.destroy()
if not context.sites:
raise SiteNotSpecifiedError