Fix utils.get not to make gratuitous copies of local dir trees
Signed-off-by: Martin J. Bligh <mbligh@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@834 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/utils.py b/server/utils.py
index 4f4b4ea..7738f52 100644
--- a/server/utils.py
+++ b/server/utils.py
@@ -72,7 +72,7 @@
return sh_escape("".join(new_name))
-def get(location):
+def get(location, local_copy = False):
"""Get a file or directory to a local temporary directory.
Args:
@@ -106,6 +106,8 @@
return tmpfile
# location is a local path
elif os.path.exists(os.path.abspath(location)):
+ if not local_copy:
+ return location
tmpfile = os.path.join(tmpdir, os.path.basename(location))
if os.path.isdir(location):
tmpfile += '/'