From 3969e4c7fb31a40bb8777f9666abe3e8128f2241 Mon Sep 17 00:00:00 2001 From: Jonathan Cave Date: Wed, 25 Nov 2020 18:42:54 +0000 Subject: snap_tests.py: fix exit code, add core20 Ensure that the return value of each subcommand actually impacts the test result. Add core20 to the list of core snaps. --- bin/snap_tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/snap_tests.py b/bin/snap_tests.py index fe80288..bcfb48c 100755 --- a/bin/snap_tests.py +++ b/bin/snap_tests.py @@ -37,7 +37,7 @@ class SnapList(): """snap list should show the core package is installed.""" data = Snapd().list() for snap in data: - if snap['name'] in ('core', 'core16', 'core18'): + if snap['name'] in ('core', 'core16', 'core18', 'core20'): print("Found a core snap") print(snap['name'], snap['version'], snap['revision']) return 0 @@ -189,8 +189,8 @@ class Snap(): parser = argparse.ArgumentParser() parser.add_argument('subcommand', type=str, choices=sub_commands) args = parser.parse_args(sys.argv[1:2]) - sub_commands[args.subcommand]().invoked() + return sub_commands[args.subcommand]().invoked() if __name__ == '__main__': - Snap().main() + sys.exit(Snap().main()) -- cgit v1.2.3