Reduce duplicate Attach() calls in bdev
[ganeti-local] / lib / ssh.py
index 2b06a58..6f32e56 100644 (file)
@@ -163,14 +163,14 @@ class SshRunner:
       success: True/False
 
     """
-    if not os.path.isfile(filename):
-      logger.Error("file %s does not exist" % (filename))
-      return False
-
     if not os.path.isabs(filename):
       logger.Error("file %s must be an absolute path" % (filename))
       return False
 
+    if not os.path.isfile(filename):
+      logger.Error("file %s does not exist" % (filename))
+      return False
+
     command = [constants.SCP, "-q", "-p"]
     command.extend(KNOWN_HOSTS_OPTS)
     command.extend(BATCH_MODE_OPTS)