Preserve device names during instance move
[ganeti-local] / tools / ganeti-listrunner
index 13ab024..061d53b 100755 (executable)
@@ -64,7 +64,14 @@ import sys
 import time
 import traceback
 
-import paramiko
+try:
+  import paramiko
+except ImportError:
+  print >> sys.stderr, \
+    ("The \"paramiko\" module could not be imported. Install it from your"
+     " distribution's repository. The package is usually named"
+     " \"python-paramiko\".")
+  sys.exit(1)
 
 
 REMOTE_PATH_BASE = "/tmp/listrunner"
@@ -376,8 +383,10 @@ def HostWorker(logdir, username, password, use_agent, hostname,
         print "  %s: uploading files" % hostname
         upload_dir = UploadFiles(connection, executable,
                                  filelist, logfile)
-        command = ("cd %s && ./%s %s" %
-                   (upload_dir, os.path.basename(executable), exec_args))
+        command = ("cd %s && ./%s" %
+                   (upload_dir, os.path.basename(executable)))
+        if exec_args:
+          command += " %s" % exec_args
       print "  %s: executing remote command" % hostname
       cmd_result = RunRemoteCommand(connection, command, logfile)
       if cmd_result is True: