0
我看了at similar questions但沒有人提到我應該如何解決這個問題。我想寫一個快速和骯髒的腳本,這將幫助我引導新鮮的Fedora安裝Puppet爲我想嘗試的某些東西。從細讀這裏的問題。我有一些示例代碼可以滿足我的需求。通過Python API安裝Yum Repos的PGP密鑰
[[email protected] ~]# python puppet-bootstrap.py
[ 11/03/2012 02:16:47 PM ] begin bootstrap install for puppet client
[ 11/03/2012 02:16:47 PM ] package not found on system, installing
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 1aca3465: NOKEY
Public key for ruby-1.9.3.286-18.fc17.x86_64.rpm is not installed
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64
Importing GPG key 0x1ACA3465:
Userid : "Fedora (17) <[email protected]>"
Fingerprint: cac4 3fb7 74a4 a673 d81c 5de7 50e9 4c99 1aca 3465
Package : fedora-release-17-1.noarch (@fedora)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64
Traceback (most recent call last):
File "puppet-bootstrap.py", line 17, in <module>
yb.processTransaction()
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 6053, in processTransaction
self._checkSignatures(pkgs,callback)
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 6096, in _checkSignatures
self.getKeyForPackage(po, self._askForGPGKeyImport)
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 5798, in getKeyForPackage
raise Errors.YumBaseError, _("Didn't install any keys")
yum.Errors.YumBaseError: Didn't install any keys
那麼我會怎麼寫一個簡短的代碼來通過YUM Python API接受PGP密鑰呢?所涉及的發行版幾乎未變動,所以在此腳本的情況下,PGP密鑰必須正確簽署。任何人之前做過?