diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-06-06 13:36:23 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-06-06 13:36:23 +0200 |
commit | 89688593e9358433cd9383d1bdfae12dbcd58f72 (patch) | |
tree | 31e35046c4648a185fe346403be0d489bd9788da /cloudinit/config/cc_apt_configure.py | |
parent | dca09871e61186deb216ce5cb1fc5db3b69c9fc2 (diff) | |
download | vyos-cloud-init-89688593e9358433cd9383d1bdfae12dbcd58f72.tar.gz vyos-cloud-init-89688593e9358433cd9383d1bdfae12dbcd58f72.zip |
add_key_raw - make exceptions more specific
Diffstat (limited to 'cloudinit/config/cc_apt_configure.py')
-rw-r--r-- | cloudinit/config/cc_apt_configure.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/config/cc_apt_configure.py b/cloudinit/config/cc_apt_configure.py index 2f270662..a9ac6ea8 100644 --- a/cloudinit/config/cc_apt_configure.py +++ b/cloudinit/config/cc_apt_configure.py @@ -154,7 +154,7 @@ def add_key_raw(key): try: util.subp(('apt-key', 'add', '-'), key) except util.ProcessExecutionError: - raise Exception('failed add key') + raise ValueError('failed to add apt GPG Key to apt keyring') def add_key(ent): @@ -221,7 +221,7 @@ def add_sources(srclist, template_params=None, aa_repo_match=None): # keys can be added without specifying a source try: add_key(ent) - except Exception as detail: + except ValueError as detail: errorlist.append([ent, detail]) if 'source' not in ent: |