From dda1bbc41adb9cc58f844e614e5bf0080206df5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 17 Mar 2014 21:26:42 +0100 Subject: [PATCH] backups/qvm-backup: show all warnings at one place, clarify pass phrase prompt (#801) --- qvm-tools/qvm-backup | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/qvm-tools/qvm-backup b/qvm-tools/qvm-backup index 60d70f24..43b0e43f 100755 --- a/qvm-tools/qvm-backup +++ b/qvm-tools/qvm-backup @@ -85,8 +85,6 @@ def main(): vms = [qvm_collection.get_vm_by_name(vmname) for vmname in args[1:]] if options.appvm: - print >>sys.stderr, ("WARNING: VM {} excluded because it's used to " - "store the backup.").format(options.appvm) options.exclude_list.append(options.appvm) if options.appvm or options.crypto_algorithm: @@ -135,11 +133,26 @@ def main(): if not appvm.is_running(): appvm.start(verbose=True) + if options.appvm: + print >>sys.stderr, ("WARNING: VM {} excluded because it's used to " + "store the backup.").format(options.appvm) + options.exclude_list.append(options.appvm) + + if not options.encrypt: + print >>sys.stderr, "WARNING: encryption will not be used" + prompt = raw_input ("Do you want to proceed? [y/N] ") if not (prompt == "y" or prompt == "Y"): exit (0) - passphrase = getpass.getpass("Please enter the pass phrase that will be used to encrypt/verify the backup: ") + if options.encrypt: + passphrase = getpass.getpass("Please enter the pass phrase that will " + "be used to encrypt and verify the " + "backup: ") + else: + passphrase = getpass.getpass("Please enter the pass phrase that will " + "be used to verify the backup: ") + passphrase2 = getpass.getpass("Enter again for verification: ") if passphrase != passphrase2: print >>sys.stderr, "ERROR: Password mismatch"