summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-10-24 13:55:47 +0200
committerMartin Kosek <mkosek@redhat.com>2013-10-30 11:55:10 +0100
commite6c06b08d88f3604050e503b8998487caa9aea22 (patch)
tree0d4eeee7ed0a8a7f14061f99d5742aa0043f8fe7 /ipatests
parentdbf10b83bd61fd7e654beb47bc05c070c6dcdd4e (diff)
downloadfreeipa-e6c06b08d88f3604050e503b8998487caa9aea22.tar.gz
freeipa-e6c06b08d88f3604050e503b8998487caa9aea22.tar.xz
freeipa-e6c06b08d88f3604050e503b8998487caa9aea22.zip
Tests: mkdir_recursive: Don't fail when top-level directory doesn't exist
When the directory directly under root (e.g. /etc) did not exist, mkdir_recursive failed. Fix the issue.
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_integration/transport.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipatests/test_integration/transport.py b/ipatests/test_integration/transport.py
index a0bd3700..9b3dd5be 100644
--- a/ipatests/test_integration/transport.py
+++ b/ipatests/test_integration/transport.py
@@ -87,10 +87,10 @@ class Transport(object):
def mkdir_recursive(self, path):
"""`mkdir -p` on the remote host"""
- if not path or path == '/':
- raise ValueError('Invalid path')
- if not self.file_exists(path or '/'):
- self.mkdir_recursive(os.path.dirname(path))
+ if not self.file_exists(path):
+ parent_path = os.path.dirname(path)
+ if path != parent_path:
+ self.mkdir_recursive(parent_path)
self.mkdir(path)
def get_file(self, remotepath, localpath):