Further improve reliability of make_tree_from.
[htsworkflow.git] / htsworkflow / submission / results.py
index 4f815ad43f716775803f0e3c593cba787e6ca9bc..36c2c78e7b2b0aac0613217ec2171f84a3c727ba 100644 (file)
@@ -51,9 +51,14 @@ class ResultMap(MutableMapping):
         if destpath is None:
             destpath = os.getcwd()
 
+        LOGGER.debug("Source_path: %s", source_path)
+        LOGGER.debug("Dest_path: %s", destpath)
         for lib_id in self.results_order:
-            abs_lib_path = os.path.abspath(self.results[lib_id])
-            lib_path = os.path.relpath(abs_lib_path, destpath)
+            lib_path = self.results[lib_id]
+            LOGGER.debug("lib_path: %s", lib_path)
+            if os.path.isabs(lib_path):
+                lib_path = os.path.relpath(lib_path, destpath)
+
             LOGGER.debug('lib_path: %s', lib_path)
             lib_destination = os.path.join(destpath, lib_path)
             if not os.path.exists(lib_destination):