Skip to content
Snippets Groups Projects
Commit 2c88a50f authored by Wouter Klijn's avatar Wouter Klijn
Browse files

Task #3375: change order create dir

parent d21a69a4
No related branches found
No related tags found
No related merge requests found
...@@ -65,16 +65,16 @@ class copier(LOFARnodeTCP): ...@@ -65,16 +65,16 @@ class copier(LOFARnodeTCP):
def _copy_single_file_using_rsync(self, source_node, source_path, def _copy_single_file_using_rsync(self, source_node, source_path,
target_path): target_path):
# assure that target dir exists (rsync creates it but..
# an error in the python code will throw a nicer error
create_directory(os.path.dirname(target_path))
#check if the targat_path is writable for the current proc #check if the targat_path is writable for the current proc
if not os.access(os.path.dirname(target_path), os.W_OK): if not os.access(os.path.dirname(target_path), os.W_OK):
message = "No write acces to target path: {0}".format(target_path) message = "No write acces to target path: {0}".format(os.path.dirname(target_path))
self.logger.error(message) self.logger.error(message)
raise IOError(message) raise IOError(message)
# assure that target dir exists (rsync creates it but..
# an error in the python code will throw a nicer error
create_directory(os.path.dirname(target_path))
# construct copy command # construct copy command
command = ["rsync", "-r", "{0}:{1}".format(source_node, source_path) , command = ["rsync", "-r", "{0}:{1}".format(source_node, source_path) ,
"{0}".format(target_path)] "{0}".format(target_path)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment