diff options
| author | Jonathan Cave <jonathan.cave@canonical.com> | 2020-11-25 18:42:54 +0000 |
|---|---|---|
| committer | Jonathan Cave <jonathan.cave@canonical.com> | 2020-11-25 18:42:54 +0000 |
| commit | 3969e4c7fb31a40bb8777f9666abe3e8128f2241 (patch) | |
| tree | 9345f48d1bfbc805fedcf709cac174a454725d1d | |
| parent | 22dda6a1fa8d68d0466b5cfc87b96e0c5ed36180 (diff) | |
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.
| -rwxr-xr-x | bin/snap_tests.py | 6 |
1 files changed, 3 insertions, 3 deletions
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()) |
