backups: unify compress/encrypt parameter names
This commit is contained in:
parent
8d445beebb
commit
4b493b6d9a
@ -343,8 +343,8 @@ class SendWorker(Process):
|
|||||||
print "Finished sending thread"
|
print "Finished sending thread"
|
||||||
|
|
||||||
def backup_do(base_backup_dir, files_to_backup, passphrase,
|
def backup_do(base_backup_dir, files_to_backup, passphrase,
|
||||||
progress_callback = None, encrypt=False, appvm=None,
|
progress_callback = None, encrypted=False, appvm=None,
|
||||||
compress = False):
|
compressed=False):
|
||||||
total_backup_sz = 0
|
total_backup_sz = 0
|
||||||
for file in files_to_backup:
|
for file in files_to_backup:
|
||||||
total_backup_sz += file["size"]
|
total_backup_sz += file["size"]
|
||||||
@ -466,19 +466,19 @@ def backup_do(base_backup_dir, files_to_backup, passphrase,
|
|||||||
'addproc': tar_sparse,
|
'addproc': tar_sparse,
|
||||||
'progress_callback': compute_progress,
|
'progress_callback': compute_progress,
|
||||||
}
|
}
|
||||||
if encrypt:
|
if encrypted:
|
||||||
# Start encrypt
|
# Start encrypt
|
||||||
# If no cipher is provided, the data is forwarded unencrypted !!!
|
# If no cipher is provided, the data is forwarded unencrypted !!!
|
||||||
encryptor = subprocess.Popen (["openssl", "enc",
|
encryptor = subprocess.Popen (["openssl", "enc",
|
||||||
"-e", "-aes-256-cbc",
|
"-e", "-aes-256-cbc",
|
||||||
"-pass", "pass:"+passphrase] +
|
"-pass", "pass:"+passphrase] +
|
||||||
(["-z"] if compress else []),
|
(["-z"] if compressed else []),
|
||||||
stdin=pipe, stdout=subprocess.PIPE)
|
stdin=pipe, stdout=subprocess.PIPE)
|
||||||
run_error = wait_backup_feedback(
|
run_error = wait_backup_feedback(
|
||||||
in_stream=encryptor.stdout, streamproc=encryptor,
|
in_stream=encryptor.stdout, streamproc=encryptor,
|
||||||
**common_args)
|
**common_args)
|
||||||
elif compress:
|
elif compressed:
|
||||||
compressor = subprocess.Popen (["gzip"],
|
compressor = subprocess.Popen (["gzip"],
|
||||||
stdin=pipe, stdout=subprocess.PIPE)
|
stdin=pipe, stdout=subprocess.PIPE)
|
||||||
run_error = wait_backup_feedback(
|
run_error = wait_backup_feedback(
|
||||||
in_stream=compressor.stdout, streamproc=compressor,
|
in_stream=compressor.stdout, streamproc=compressor,
|
||||||
|
@ -123,8 +123,8 @@ def main():
|
|||||||
try:
|
try:
|
||||||
backup_do(base_backup_dir, files_to_backup, passphrase,
|
backup_do(base_backup_dir, files_to_backup, passphrase,
|
||||||
progress_callback=print_progress,
|
progress_callback=print_progress,
|
||||||
encrypt=options.encrypt,
|
encrypted=options.encrypt,
|
||||||
compress=options.compress,
|
compressed=options.compress,
|
||||||
appvm=appvm)
|
appvm=appvm)
|
||||||
except QubesException as e:
|
except QubesException as e:
|
||||||
print >>sys.stderr, "ERROR: %s" % str(e)
|
print >>sys.stderr, "ERROR: %s" % str(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user