From 0dad5b3ee517692ddb0afb32cb0e031d3ec4d78d Mon Sep 17 00:00:00 2001 From: David Hows Date: Fri, 13 Oct 2017 05:14:48 +1100 Subject: [PATCH] Make --trusted default when running spack gpg list (#5678) * Make --trusted default when running spack gpg list Currently running `spack gpg list` with no arguments returns nothing. You must supply either the `--trusted` or the `--signing` options. The idea here is to return some initial data to the user when the command is run. The alternative is to return an error, telling the user to select one of the two options. * Add an extra test case for the empty list command Fixes the issue with code coverage --- lib/spack/spack/cmd/gpg.py | 2 +- lib/spack/spack/test/cmd/gpg.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/cmd/gpg.py b/lib/spack/spack/cmd/gpg.py index 6073212c86..bf42eff48f 100644 --- a/lib/spack/spack/cmd/gpg.py +++ b/lib/spack/spack/cmd/gpg.py @@ -82,7 +82,7 @@ def setup_parser(subparser): list = subparsers.add_parser('list') list.add_argument('--trusted', action='store_true', - help='list trusted keys') + default=True, help='list trusted keys') list.add_argument('--signing', action='store_true', help='list keys which may be used for signing') list.set_defaults(func=gpg_list) diff --git a/lib/spack/spack/test/cmd/gpg.py b/lib/spack/spack/test/cmd/gpg.py index 2ceb0852e9..66e197ccd6 100644 --- a/lib/spack/spack/test/cmd/gpg.py +++ b/lib/spack/spack/test/cmd/gpg.py @@ -98,6 +98,7 @@ def test_gpg(gpg, tmpdir, testing_gpg_directory): # List the keys. # TODO: Test the output here. + gpg('list') gpg('list', '--trusted') gpg('list', '--signing')