Skip to content

Commit 38a86e1

Browse files
committed
If copy is over SSH, add options for publickey
1 parent 9820405 commit 38a86e1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/dmu/fsystem/fcopy.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,15 @@ def copy(self, source : Path, target : Path) -> bool:
143143
log.debug('--->')
144144
log.debug(target)
145145

146-
spath = self._get_path(source, is_source= True)
147-
tpath = self._get_path(target, is_source=False)
148-
commands = ['rsync', '-a', spath, tpath]
146+
spath = self._get_path(source, is_source= True)
147+
tpath = self._get_path(target, is_source=False)
149148

149+
if self._source or self._target:
150+
commands = ['rsync', '-a', '-e', 'ssh -o PubkeyAuthentication=yes -o PasswordAuthentication=no', spath, tpath]
151+
else:
152+
commands = ['rsync', '-a', spath, tpath]
153+
154+
log.debug(' '.join(commands))
150155
subprocess.run(commands)
151156

152157
return True

0 commit comments

Comments
 (0)