From 30acff6cda2b3c912a87e71768059c669964ab6e Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Mon, 28 Jun 2010 15:50:24 +0200
Subject: [PATCH] cfgupgrade: Fix bug when checking configuration directory
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/cfgupgrade b/tools/cfgupgrade
index 7e57ea243..593ca44ad 100755
--- a/tools/cfgupgrade
+++ b/tools/cfgupgrade
@@ -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)
-- 
GitLab