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"
This commit is contained in:
Eduardo Suarez-Santana 2017-10-05 13:45:14 +01:00 committed by Martin Krizek
parent 2e4dcc9dda
commit 4337b7a777

View file

@ -183,7 +183,7 @@ class RpmKey(object):
def drop_key(self, keyid): def drop_key(self, keyid):
if not self.module.check_mode: 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(): def main():