Fix directory creation when copying output to remotes.
authorCarl Hetherington <carl@cs2s.cs>
Sun, 9 Nov 2014 22:13:13 +0000 (22:13 +0000)
committerCarl Hetherington <carl@cs2s.cs>
Sun, 9 Nov 2014 22:13:13 +0000 (22:13 +0000)
cdist

diff --git a/cdist b/cdist
index d6fbb0a9157cf356cb4a81d0dea61e0f4c6b283e..1c4f8c88cc5336a47c3951322e58bc47ee521e1b 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -128,6 +128,13 @@ def copyfile(a, b):
     log('copy %s -> %s' % (scp_escape(a), scp_escape(b)))
     os.system('scp %s %s' % (scp_escape(a), scp_escape(b)))
 
+def makedirs(d):
+    if d.find(':') == -1:
+        os.makedirs(d)
+    else:
+        s = d.split(':')
+        os.system('ssh %s -- mkdir %s' % (s[0], s[1])
+
 def rmdir(a):
     log('remove %s' % a)
     os.rmdir(a)
@@ -657,7 +664,7 @@ def main():
         if target.platform == 'linux':
             out = '%s%s-%s-%d' % (args.output, target.distro, target.version, target.bits)
             try:
-                os.makedirs(out)
+                makedirs(out)
             except:
                 pass
             for p in packages: