move sys.exit out of try finally block in set_config.py file

when code exit by using sys.exit in try..catch block, it will skip catch
and run the code in finally. Because SystemExit does not inherit from
Exception.

This patch moves sys.exit out of finally block. Then it won't execute
when script exits by sys.exit

Change-Id: I6457b1b861d2f9fdadce788ac6b719f46c7f2af3
Partial-Bug: #1631503
This commit is contained in:
Jeffrey Zhang 2016-10-14 16:44:54 +08:00
parent 4bda9aa844
commit d1676d38e4

View File

@ -305,5 +305,4 @@ if __name__ == "__main__":
except Exception: except Exception:
exit_code = 1 exit_code = 1
LOG.exception('Unexpected error:') LOG.exception('Unexpected error:')
finally: sys.exit(exit_code)
sys.exit(exit_code)