Revision fdb85e3d tools/cfgupgrade

b/tools/cfgupgrade
1 1
#!/usr/bin/python
2 2
#
3 3

  
4
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
4
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc.
5 5
#
6 6
# This program is free software; you can redistribute it and/or modify
7 7
# it under the terms of the GNU General Public License as published by
......
334 334
    raise
335 335

  
336 336
  # test loading the config file
337
  all_ok = True
337 338
  if not (options.dry_run or options.no_verify):
338 339
    logging.info("Testing the new config file...")
339 340
    cfg = config.ConfigWriter(cfg_file=options.CONFIG_DATA_PATH,
......
345 346
      logging.error("Errors after conversion:")
346 347
      for item in vrfy:
347 348
        logging.error(" - %s", item)
349
      all_ok = False
350
    else:
351
      logging.info("File loaded successfully after upgrading")
348 352
    del cfg
349
    logging.info("File loaded successfully")
350 353

  
351
  cli.ToStderr("Configuration successfully upgraded for version %s.",
352
               constants.RELEASE_VERSION)
354
  if all_ok:
355
    cli.ToStderr("Configuration successfully upgraded to version %s.",
356
                 constants.RELEASE_VERSION)
357
  else:
358
    cli.ToStderr("Configuration upgraded to version %s, but there are errors."
359
                 "\nPlease review the file.", constants.RELEASE_VERSION)
353 360

  
354 361

  
355 362
if __name__ == "__main__":

Also available in: Unified diff