summaryrefslogtreecommitdiff
path: root/cloudinit/gpg.py
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-08-10 16:43:14 +0200
committerScott Moser <smoser@brickies.net>2016-08-18 11:02:44 -0400
commitd861415ff9ab816b1183b8c58ec35348be4fd458 (patch)
treed3cc08c685f58208979c0fc6e941320cc1347b2b /cloudinit/gpg.py
parent648dbbf6b090c81e989f1ab70bf99f4de16a6a70 (diff)
downloadvyos-cloud-init-d861415ff9ab816b1183b8c58ec35348be4fd458.tar.gz
vyos-cloud-init-d861415ff9ab816b1183b8c58ec35348be4fd458.zip
Apt: add new apt configuration format
This adds an improved apt configuration format that is fully backwards compatible with previous behavior. This is mostly copied from curtin's implementation. It does: * clean up and centralizes many of the top level 'apt_*' values that previously existed into a single top level 'apt'key. * support a 'source' in apt/sources/entry that has only a key * documents new features and adds tests. See the added doc/examples/cloud-config-apt.txt for more information.
Diffstat (limited to 'cloudinit/gpg.py')
-rw-r--r--cloudinit/gpg.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/gpg.py b/cloudinit/gpg.py
index 6a76d785..5bbff513 100644
--- a/cloudinit/gpg.py
+++ b/cloudinit/gpg.py
@@ -36,11 +36,11 @@ def export_armour(key):
return armour
-def receive_key(key, keyserver):
+def recv_key(key, keyserver):
"""Receive gpg key from the specified keyserver"""
LOG.debug('Receive gpg key "%s"', key)
try:
- util.subp(["gpg", "--keyserver", keyserver, "--recv-keys", key],
+ util.subp(["gpg", "--keyserver", keyserver, "--recv", key],
capture=True)
except util.ProcessExecutionError as error:
raise ValueError(('Failed to import key "%s" '
@@ -57,12 +57,12 @@ def delete_key(key):
LOG.warn('Failed delete key "%s": %s', key, error)
-def get_key_by_id(keyid, keyserver="keyserver.ubuntu.com"):
+def getkeybyid(keyid, keyserver='keyserver.ubuntu.com'):
"""get gpg keyid from keyserver"""
armour = export_armour(keyid)
if not armour:
try:
- receive_key(keyid, keyserver=keyserver)
+ recv_key(keyid, keyserver=keyserver)
armour = export_armour(keyid)
except ValueError:
LOG.exception('Failed to obtain gpg key %s', keyid)