kvm-test: don't execute code if module is imported
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
parent
9ad7ff2747
commit
83dacb8c7c
|
@ -456,6 +456,8 @@ def help():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
""" Entry point. """
|
||||||
try:
|
try:
|
||||||
ctx = parse_args()
|
ctx = parse_args()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
@ -474,3 +476,7 @@ if ctx.args.boot:
|
||||||
boot(ctx)
|
boot(ctx)
|
||||||
if True not in (ctx.args.build, ctx.args.install, ctx.args.boot):
|
if True not in (ctx.args.build, ctx.args.install, ctx.args.boot):
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
Loading…
Reference in New Issue