File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,17 +67,19 @@ def sync_to_resource(self, symlink=None):
6767 self .local_path ,
6868 f"{ self .rpath } { os .path .basename (self .local_path )} "
6969 )
70-
71- if symlink is not None :
72- self .logger .info ("Linking" )
73- try :
74- conn .run_check (f"test ! -e { symlink } -o -L { symlink } " )
75- except ExecutionError :
76- raise ManagedFileError (f"Path { symlink } exists but is not a symlink." )
77- # use short options to be compatible with busybox
78- # --symbolic --force --no-dereference
79- conn .run_check (f"ln -sfn { self .rpath } { os .path .basename (self .local_path )} { symlink } " )
80-
70+ else :
71+ conn = sshmanager .open ("localhost" )
72+ self .rpath = os .path .dirname (self .local_path ) + "/"
73+
74+ if symlink is not None :
75+ self .logger .info ("Linking" )
76+ try :
77+ conn .run_check (f"test ! -e { symlink } -o -L { symlink } " )
78+ except ExecutionError :
79+ raise ManagedFileError (f"Path { symlink } exists but is not a symlink." )
80+ # use short options to be compatible with busybox
81+ # --symbolic --force --no-dereference
82+ conn .run_check (f"ln -sfn { self .rpath } { os .path .basename (self .local_path )} { symlink } " )
8183
8284 def _on_nfs (self , conn ):
8385 if self ._on_nfs_cached is not None :
You can’t perform that action at this time.
0 commit comments