From 02e1292df083ecc12141036ffdd04d857ffb04c8 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Mon, 28 Jun 2010 15:49:46 +0200
Subject: [PATCH] cfgupgrade: Add option to override config verification

This is needed in a new test script for cfgupgrade where it's better
to only use the minimum parts necessary for testing cfgupgrade.
Including full configuration data to ensure verification doesn't fail
would make maintenance difficult.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 tools/cfgupgrade | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/cfgupgrade b/tools/cfgupgrade
index 593ca44ad..00dbb222f 100755
--- a/tools/cfgupgrade
+++ b/tools/cfgupgrade
@@ -90,6 +90,9 @@ def main():
   parser.add_option('--path', help="Convert configuration in this"
                     " directory instead of '%s'" % constants.DATA_DIR,
                     default=constants.DATA_DIR, dest="data_dir")
+  parser.add_option("--no-verify",
+                    help="Do not verify configuration after upgrade",
+                    action="store_true", dest="no_verify", default=False)
   (options, args) = parser.parse_args()
 
   # We need to keep filenames locally because they might be renamed between
@@ -173,7 +176,7 @@ def main():
     raise
 
   # test loading the config file
-  if not options.dry_run:
+  if not (options.dry_run or options.no_verify):
     logging.info("Testing the new config file...")
     cfg = config.ConfigWriter(cfg_file=options.CONFIG_DATA_PATH,
                               offline=True)
-- 
GitLab