From cfe4fe5fcfd1b46084181bf9925606416d74b2b5 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 7 Sep 2020 20:37:55 +0530 Subject: [PATCH] fix: Added base verbosity for success/failure in backup command --- frappe/commands/site.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frappe/commands/site.py b/frappe/commands/site.py index ec479d76ca..bcffc3fbc7 100755 --- a/frappe/commands/site.py +++ b/frappe/commands/site.py @@ -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