mirror of
https://github.com/borgbase/vorta
synced 2025-01-03 05:36:19 +00:00
simplify code
one line more, but easier and only 1 dict access instead of 3.
This commit is contained in:
parent
94e21ab001
commit
d6ab81c37e
1 changed files with 6 additions and 4 deletions
|
@ -42,12 +42,14 @@ def __init__(self, cmd, params, parent=None):
|
|||
|
||||
env = os.environ.copy()
|
||||
env['BORG_HOSTNAME_IS_UNIQUE'] = '1'
|
||||
if params.get('password') and params['password'] is not None:
|
||||
env['BORG_PASSPHRASE'] = params['password']
|
||||
password = params.get('password')
|
||||
if password is not None:
|
||||
env['BORG_PASSPHRASE'] = password
|
||||
|
||||
env['BORG_RSH'] = 'ssh -oStrictHostKeyChecking=no'
|
||||
if params.get('ssh_key') and params['ssh_key'] is not None:
|
||||
env['BORG_RSH'] += f' -i ~/.ssh/{params["ssh_key"]}'
|
||||
ssh_key = params.get('ssh_key')
|
||||
if ssh_key is not None:
|
||||
env['BORG_RSH'] += f' -i ~/.ssh/{ssh_key}'
|
||||
|
||||
self.env = env
|
||||
self.cmd = cmd
|
||||
|
|
Loading…
Reference in a new issue