From a45bfbe06eaaf8b0de02c0b62be332e6db286af8 Mon Sep 17 00:00:00 2001 From: aresch Date: Thu, 6 Mar 2014 16:12:11 -0800 Subject: [PATCH] Fix rpm_key on system with no gpg keys imported Without the -a option, rpm command will fail (exit code 1) and execute_command() will fail causing an initial key import to not work. [root@test ~]# rpm -q gpg-pubkey package gpg-pubkey is not installed [root@test ~]# echo $? 1 [root@test ~]# rpm -qa gpg-pubkey [root@test ~]# echo $? 0 --- library/packaging/rpm_key | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/packaging/rpm_key b/library/packaging/rpm_key index 82532477348..e9c3f34bd7f 100644 --- a/library/packaging/rpm_key +++ b/library/packaging/rpm_key @@ -161,7 +161,7 @@ class RpmKey: return stdout, stderr def is_key_imported(self, keyid): - stdout, stderr = self.execute_command([self.rpm, '-q', 'gpg-pubkey']) + stdout, stderr = self.execute_command([self.rpm, '-qa', 'gpg-pubkey']) for line in stdout.splitlines(): line = line.strip() if not line: