Skip to content

Commit

Permalink
charm-helpers sync
Browse files Browse the repository at this point in the history
  • Loading branch information
dosaboy committed Feb 11, 2016
1 parent c617aa5 commit 6031103
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions charmhelpers/contrib/openstack/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ def os_release(package, base='essex'):
return os_rel


def import_pgp_key(key):
key = key.strip()
def import_key(keyid):
key = keyid.strip()
if (key.startswith('-----BEGIN PGP PUBLIC KEY BLOCK-----') and
key.endswith('-----END PGP PUBLIC KEY BLOCK-----')):
juju_log("PGP key found (looks like ASCII Armor format)", level=DEBUG)
Expand Down Expand Up @@ -398,13 +398,13 @@ def configure_installation_source(rel):
elif rel[:4] == "ppa:":
src, key = get_source_and_pgp_key(rel)
if key:
import_pgp_key(key)
import_key(key)

subprocess.check_call(["add-apt-repository", "-y", src])
elif rel[:3] == "deb":
src, key = get_source_and_pgp_key(rel)
if key:
import_pgp_key(key)
import_key(key)

with open('/etc/apt/sources.list.d/juju_deb.list', 'w') as f:
f.write(src)
Expand Down

0 comments on commit 6031103

Please sign in to comment.