cfgupgrade: Fix bug when checking configuration directory
authorMichael Hanselmann <hansmi@google.com>
Mon, 28 Jun 2010 13:50:24 +0000 (15:50 +0200)
committerMichael Hanselmann <hansmi@google.com>
Tue, 29 Jun 2010 10:47:34 +0000 (12:47 +0200)
In the condition for checking the configuration directory, one “or” should have
been an “and”. This bug was in cfgupgrade since commit 95e4a8142 (June 2008).
Found thanks to a test script.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

tools/cfgupgrade

index 7e57ea2..593ca44 100755 (executable)
@@ -116,7 +116,7 @@ def main():
 
   # Check whether it's a Ganeti configuration directory
   if not (os.path.isfile(options.CONFIG_DATA_PATH) and
-          os.path.isfile(options.SERVER_PEM_PATH) or
+          os.path.isfile(options.SERVER_PEM_PATH) and
           os.path.isfile(options.KNOWN_HOSTS_PATH)):
     raise Error(("%s does not seem to be a Ganeti configuration"
                  " directory") % options.data_dir)