Browse Source

make call() python 3.6 compatible

master
Holger Frey 5 years ago
parent
commit
598d16671e
  1. 6
      zfs-snapshot-backup.py

6
zfs-snapshot-backup.py

@ -13,9 +13,9 @@ ZFS_ELAB_PREFIX = "elabfs-"
TMP_BACKUP_FOLDER = "/mnt/Datenspeicher/snap-backup-dataset/temporary-backups" TMP_BACKUP_FOLDER = "/mnt/Datenspeicher/snap-backup-dataset/temporary-backups"
def call(arguments): def call(arguments, as_text=False):
result = subprocess.run( result = subprocess.run(
arguments, check=True, capture_output=True, text=True arguments, check=True, stdout=subprocess.PIPE, universal_newlines=as_text
) )
return result.stdout return result.stdout
@ -23,7 +23,7 @@ def call(arguments):
def remote_call(arguments): def remote_call(arguments):
cmd = ["ssh", "-i", SSH_KEY_FILE, SSH_REMOTE] cmd = ["ssh", "-i", SSH_KEY_FILE, SSH_REMOTE]
cmd.extend(arguments) cmd.extend(arguments)
return call(cmd) return call(cmd, as_text=True)
def clean_split(text): def clean_split(text):

Loading…
Cancel
Save