Juan Antonio Osorio Robles 14765056fb Handle SystemExit properly in migration script
The migration script was catching all exceptions and using
log.exception in case there was any. The problem is, argparse raises a
SystemExit exception after printing the "help" with an exit code of 0.
This would eventually get caught as an exception. Being this an
exception, the logging would print the stack trace, which in the case
of a proper exit would be very confusing, as one might think there is
a problem, when there isn't.

This change now omits the logging if there as a system exit with a 0
or None code (Which is the default code if you call "sys.exit()").

Also, some pep8 issues were fixed here.

Change-Id: I300358e28b39a8a65d7b4253dcca975b46bf757c
2015-01-28 14:22:41 +02:00
..
2014-09-19 15:19:47 -05:00