Commit e5cb2569 authored by Luong Anh Tuan's avatar Luong Anh Tuan Committed by Tuan Luong-Anh

Using sys.exit(main()) instead of main()

TrivialFix: Similar [1] in Kolla project
As we known, Exceptions are raised by the sys.exit() function. When they
are not handled, no stack traceback is printed in the Python interpreter.
Therefore, when using sys.exit(main()) instead of main()
may be more readable and reasonable.

[1] https://review.openstack.org/#/c/349353/

Change-Id: Ied52a7631da82a72f0dcf2fc9ed81840d24041d9
parent cc981cf4
......@@ -362,4 +362,4 @@ def main():
pprint.pformat(resp.json())))
if __name__ == '__main__':
main()
sys.exit(main())
......@@ -208,4 +208,4 @@ def main():
LOG.error(e)
if __name__ == '__main__':
main()
sys.exit(main())
......@@ -46,6 +46,7 @@ import os
import random
import string
import time
import sys
import dns
import dns.resolver
......@@ -660,4 +661,4 @@ def main():
if __name__ == '__main__':
main()
sys.exit(main())
......@@ -19,6 +19,7 @@ Log to stdout or to a file.
"""
from argparse import ArgumentParser
import sys
from time import gmtime
from time import strftime
import SocketServer
......@@ -57,4 +58,4 @@ def main():
server.serve_forever()
if __name__ == "__main__":
main()
sys.exit(main())
......@@ -88,4 +88,4 @@ def format_dict(raw):
return output
if __name__ == '__main__':
main()
sys.exit(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