From 7018aa33161b0aff620e068259e353fdc1e6c9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Clemens=20Wei=C3=9F?= Date: Fri, 3 Mar 2017 20:53:21 +0100 Subject: [PATCH] Update expired keys (#21539) If a key has expired it will not be added by this module, so check for "expired" in the list of keys. Example output with expired key: pub 1024D/5072E1F5 2003-02-03 [expired: 2017-02-16] uid MySQL Release Engineering --- 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 b9a05c94480..39e31f58fb2 100644 --- a/lib/ansible/modules/packaging/os/apt_key.py +++ b/lib/ansible/modules/packaging/os/apt_key.py @@ -200,7 +200,7 @@ def all_keys(module, keyring, short_format): results = [] lines = to_native(out).split('\n') for line in lines: - if line.startswith("pub") or line.startswith("sub"): + if (line.startswith("pub") or line.startswith("sub")) and not "expired" in line: tokens = line.split() code = tokens[1] (len_type, real_code) = code.split("/")