From 8d4fe2a7673fa90d65e92aecb8ff11c7f94ef623 Mon Sep 17 00:00:00 2001 From: Alexey Sheplyakov Date: Tue, 16 Aug 2016 16:01:07 +0000 Subject: [PATCH] apt_key: fix spurious failure to import a subkey (#4366) Importing a (sign only) subkey with apt_key module always fails, however the actual keyring gets created and contains the correct keys. Apparently the all_keys function skips the subkeys, hence the problem. Fixes #4365 --- lib/ansible/modules/packaging/os/apt_key.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/os/apt_key.py b/lib/ansible/modules/packaging/os/apt_key.py index 09679853f8..ebcdc3aa4b 100644 --- a/lib/ansible/modules/packaging/os/apt_key.py +++ b/lib/ansible/modules/packaging/os/apt_key.py @@ -132,7 +132,7 @@ def all_keys(module, keyring, short_format): results = [] lines = out.split('\n') for line in lines: - if line.startswith("pub"): + if line.startswith("pub") or line.startswith("sub"): tokens = line.split() code = tokens[1] (len_type, real_code) = code.split("/")