summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Hows <howsdav@gmail.com>2017-10-13 05:14:48 +1100
committerTodd Gamblin <tgamblin@llnl.gov>2017-10-12 11:14:48 -0700
commit0dad5b3ee517692ddb0afb32cb0e031d3ec4d78d (patch)
tree758a5331cd4965a324c9afebd15050ab22536ff8 /lib
parent65b38764aedf56192568f5d49eb9a9c87257761b (diff)
downloadspack-0dad5b3ee517692ddb0afb32cb0e031d3ec4d78d.tar.gz
spack-0dad5b3ee517692ddb0afb32cb0e031d3ec4d78d.tar.bz2
spack-0dad5b3ee517692ddb0afb32cb0e031d3ec4d78d.tar.xz
spack-0dad5b3ee517692ddb0afb32cb0e031d3ec4d78d.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/gpg.py2
-rw-r--r--lib/spack/spack/test/cmd/gpg.py1
2 files changed, 2 insertions, 1 deletions
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')