Fixup: copying via cls_cmd only supports absolute paths
This commit is contained in:
@@ -118,11 +118,14 @@ class LocalCmd(Cmd):
|
|||||||
def getBefore(self):
|
def getBefore(self):
|
||||||
return self.cp.stdout
|
return self.cp.stdout
|
||||||
|
|
||||||
def copyin(self, scpIp, scpUser, scpPw, src, tgt):
|
def copyin(self, src, tgt, recursive=False):
|
||||||
self.run(f'cp -r {src} {tgt}')
|
if src[0] != '/' or tgt[0] != '/':
|
||||||
|
raise Exception('support only absolute file paths!')
|
||||||
|
opt = '-r' if recursive else ''
|
||||||
|
self.run(f'cp {opt} {src} {tgt}')
|
||||||
|
|
||||||
def copyout(self, scpIp, scpUser, scpPw, src, tgt):
|
def copyout(self, src, tgt, recursive=False):
|
||||||
self.run(f'cp -r {src} {tgt}')
|
self.copyin(src, tgt, recursive)
|
||||||
|
|
||||||
class RemoteCmd(Cmd):
|
class RemoteCmd(Cmd):
|
||||||
def __init__(self, hostname, d=None):
|
def __init__(self, hostname, d=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user