summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2017-08-24 08:47:22 -0400
committerTodd Gamblin <tgamblin@llnl.gov>2017-08-24 16:17:35 -0700
commitf564b2abf75ae01ea95b6995de517c91fb0462b7 (patch)
treeaa46e69153caa391f350b9d08f07adebc692352e /lib
parenta48b5a627cb4fd18f7bd145e6bb944d5a315cfdb (diff)
downloadspack-f564b2abf75ae01ea95b6995de517c91fb0462b7.tar.gz
spack-f564b2abf75ae01ea95b6995de517c91fb0462b7.tar.bz2
spack-f564b2abf75ae01ea95b6995de517c91fb0462b7.tar.xz
spack-f564b2abf75ae01ea95b6995de517c91fb0462b7.zip
gpg: add an argument for the import directory
This is hidden because it is only meant for use by the tests.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/gpg.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/spack/spack/cmd/gpg.py b/lib/spack/spack/cmd/gpg.py
index 1f46033813..3ec6094cac 100644
--- a/lib/spack/spack/cmd/gpg.py
+++ b/lib/spack/spack/cmd/gpg.py
@@ -23,6 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack.util.gpg import Gpg
+import argparse
import spack
import os
@@ -87,8 +88,9 @@ def setup_parser(subparser):
list.set_defaults(func=gpg_list)
init = subparsers.add_parser('init')
+ init.add_argument('--from', metavar='DIR', type=str,
+ dest='import_dir', help=argparse.SUPPRESS)
init.set_defaults(func=gpg_init)
- init.set_defaults(import_dir=spack.gpg_keys_path)
export = subparsers.add_parser('export')
export.add_argument('location', type=str,
@@ -144,7 +146,11 @@ def gpg_trust(args):
def gpg_init(args):
- for root, _, filenames in os.walk(args.import_dir):
+ import_dir = args.import_dir
+ if import_dir is None:
+ import_dir = spack.gpg_keys_path
+
+ for root, _, filenames in os.walk(import_dir):
for filename in filenames:
if not filename.endswith('.key'):
continue