Commit fdb85e3d authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

cfgupgrade: Fix error messages



Messages were inconsistent. You could get both an error and a message
saying that everything was fine.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 09b7b6f2
#!/usr/bin/python
#
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -334,6 +334,7 @@ def main():
raise
# test loading the config file
all_ok = True
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,
......@@ -345,11 +346,17 @@ def main():
logging.error("Errors after conversion:")
for item in vrfy:
logging.error(" - %s", item)
all_ok = False
else:
logging.info("File loaded successfully after upgrading")
del cfg
logging.info("File loaded successfully")
cli.ToStderr("Configuration successfully upgraded for version %s.",
constants.RELEASE_VERSION)
if all_ok:
cli.ToStderr("Configuration successfully upgraded to version %s.",
constants.RELEASE_VERSION)
else:
cli.ToStderr("Configuration upgraded to version %s, but there are errors."
"\nPlease review the file.", constants.RELEASE_VERSION)
if __name__ == "__main__":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment