From 4b493b6d9a059579734356a11c1cbb080ea9b531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 15 Jan 2014 03:45:12 +0100 Subject: [PATCH] backups: unify compress/encrypt parameter names --- core/backup.py | 12 ++++++------ qvm-tools/qvm-backup | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/backup.py b/core/backup.py index 5984b8b6..9181236a 100644 --- a/core/backup.py +++ b/core/backup.py @@ -343,8 +343,8 @@ class SendWorker(Process): print "Finished sending thread" def backup_do(base_backup_dir, files_to_backup, passphrase, - progress_callback = None, encrypt=False, appvm=None, - compress = False): + progress_callback = None, encrypted=False, appvm=None, + compressed=False): total_backup_sz = 0 for file in files_to_backup: total_backup_sz += file["size"] @@ -466,19 +466,19 @@ def backup_do(base_backup_dir, files_to_backup, passphrase, 'addproc': tar_sparse, 'progress_callback': compute_progress, } - if encrypt: + if encrypted: # Start encrypt # If no cipher is provided, the data is forwarded unencrypted !!! encryptor = subprocess.Popen (["openssl", "enc", "-e", "-aes-256-cbc", "-pass", "pass:"+passphrase] + - (["-z"] if compress else []), + (["-z"] if compressed else []), stdin=pipe, stdout=subprocess.PIPE) run_error = wait_backup_feedback( in_stream=encryptor.stdout, streamproc=encryptor, **common_args) - elif compress: - compressor = subprocess.Popen (["gzip"], + elif compressed: + compressor = subprocess.Popen (["gzip"], stdin=pipe, stdout=subprocess.PIPE) run_error = wait_backup_feedback( in_stream=compressor.stdout, streamproc=compressor, diff --git a/qvm-tools/qvm-backup b/qvm-tools/qvm-backup index ce7fc281..4e4a5ce4 100755 --- a/qvm-tools/qvm-backup +++ b/qvm-tools/qvm-backup @@ -123,8 +123,8 @@ def main(): try: backup_do(base_backup_dir, files_to_backup, passphrase, progress_callback=print_progress, - encrypt=options.encrypt, - compress=options.compress, + encrypted=options.encrypt, + compressed=options.compress, appvm=appvm) except QubesException as e: print >>sys.stderr, "ERROR: %s" % str(e)