summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Suarez-Santana <e.suarezsantana@gmail.com>2017-10-05 13:45:14 +0100
committerToshio Kuratomi <a.badger@gmail.com>2017-10-05 11:50:09 -0700
commit9bcb6f437258d8b2477e6ca2714d1af97b44fe34 (patch)
treeb751230dd8e21dbcfd6b9fd8da6af95614d0b194
parentb11d2289dd46c103508da2f55ab032bd220d0e52 (diff)
downloadansible-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.py2
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():