diff options
author | Eduardo Suarez-Santana <e.suarezsantana@gmail.com> | 2017-10-05 13:45:14 +0100 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2017-10-05 11:50:09 -0700 |
commit | 9bcb6f437258d8b2477e6ca2714d1af97b44fe34 (patch) | |
tree | b751230dd8e21dbcfd6b9fd8da6af95614d0b194 | |
parent | b11d2289dd46c103508da2f55ab032bd220d0e52 (diff) | |
download | ansible-9bcb6f437258d8b2477e6ca2714d1af97b44fe34.tar.gz |
Fix rpm_key absent. (#31045)
When keyid is 8 charactes long, drop_key function cuts everything
issuing an error: "package gpg-pubkey- is not installed"
(cherry picked from commit 4337b7a7770123e1634ccc13f55c321b89667bdf)
-rw-r--r-- | lib/ansible/modules/packaging/os/rpm_key.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/modules/packaging/os/rpm_key.py b/lib/ansible/modules/packaging/os/rpm_key.py index f6deaff067..fce57f8634 100644 --- a/lib/ansible/modules/packaging/os/rpm_key.py +++ b/lib/ansible/modules/packaging/os/rpm_key.py @@ -183,7 +183,7 @@ class RpmKey(object): def drop_key(self, keyid): if not self.module.check_mode: - self.execute_command([self.rpm, '--erase', '--allmatches', "gpg-pubkey-%s" % keyid[8:].lower()]) + self.execute_command([self.rpm, '--erase', '--allmatches', "gpg-pubkey-%s" % keyid[-8:].lower()]) def main(): |