summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/util.py1
-rw-r--r--tests/unittests/test_handler/test_handler_apt_source.py8
2 files changed, 2 insertions, 7 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index a1622946..d3b14f72 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -2244,7 +2244,6 @@ def gpg_export_armour(key):
def gpg_recv_key(key, keyserver):
"""Receive gpg key from the specified keyserver"""
- print("ORIGINAL gpg_recv_key")
try:
subp(["gpg", "--keyserver", keyserver, "--recv", key],
capture=True)
diff --git a/tests/unittests/test_handler/test_handler_apt_source.py b/tests/unittests/test_handler/test_handler_apt_source.py
index 65e375a0..c7eeb64c 100644
--- a/tests/unittests/test_handler/test_handler_apt_source.py
+++ b/tests/unittests/test_handler/test_handler_apt_source.py
@@ -452,13 +452,11 @@ class TestAptSourceConfig(TestCase):
"""
params = self._get_default_params()
- def fake_gpg_recv_key(self, key, keyserver):
+ def fake_gpg_recv_key(key, keyserver):
"""try original gpg_recv_key, but allow fall back"""
try:
- print("Try orig orig_gpg_recv_key")
self.orig_gpg_recv_key(key, keyserver)
- except ValueError:
- print("Fail, test net")
+ except ValueError as error:
# if this is a networking issue mock it's effect
testsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
@@ -466,10 +464,8 @@ class TestAptSourceConfig(TestCase):
testsock.close()
except socket.error:
# as fallback add the known key as a working recv would
- print("Fallback import expectedkey")
util.subp(("gpg", "--import", "-"), EXPECTEDKEY)
- print("FOO")
with mock.patch.object(cc_apt_configure, 'add_key_raw') as mockkey:
with mock.patch.object(util, 'gpg_recv_key',
side_effect=fake_gpg_recv_key) as mockrecv: