Re: Install packages into rootfs using python API - fails during key installing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All!

2013/7/19 Peter Lemenkov <lemenkov@xxxxxxxxx>:
> Hello All!
>
> I'm facing the following issue. I've got a valid rootfs skeleton which
> I'm populating with the following command w/o an errors:
>
> * yum install -y --releasever=6
> --installroot=/vmroot/test/rootfs_testrootfs openssh-server plymouth
> rsyslog acpid ntp epel-release
>
> Now I'm trying to do the same with pure python API:
>
> =================
> #!/usr/bin/python
> import yum
> yb = yum.YumBase()
> yb.conf.installroot = "/vmroot/test/rootfs_testrootfs"
> yb.conf.yumvar['releasever'] = '6'
> for i in ("openssh-server", "plymouth", "rsyslog", "acpid", "ntp",
> "epel-release"):
>     yb.install(name=i)
> yb.resolveDeps()
> yb.buildTransaction()
> yb.processTransaction()
> =================
>
> And I suddenly got the following issue:
>
> =================
> [root@virttest vmroot]# python testd.py
> Loaded plugins: fastestmirror
> Loading mirror speeds from cached hostfile
>  * base: centos-mirror.rbc.ru
>  * epel: fedora-mirror01.rbc.ru
>  * extras: centos-mirror.rbc.ru
>  * updates: mirror.logol.ru
> warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
> Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
> Importing GPG key 0xC105B9DE:
>  Userid: "CentOS-6 Key (CentOS 6 Official Signing Key)
> <centos-6-key@xxxxxxxxxx>"
>  From  : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
> Traceback (most recent call last):
>   File "testd.py", line 11, in <module>
>     yb.processTransaction()
>   File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 4989,
> in processTransaction
>     self._checkSignatures(pkgs,callback)
>   File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 5032,
> in _checkSignatures
>     self.getKeyForPackage(po, self._askForGPGKeyImport)
>   File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 4754,
> in getKeyForPackage
>     raise Errors.YumBaseError, _("Didn't install any keys")
> yum.Errors.YumBaseError: Didn't install any keys
> [root@virttest vmroot]#
> =================
>
> I found this unanswered question at stackoverflow and that's all:
>
> * http://stackoverflow.com/questions/13224166/installing-pgp-key-for-yum-repos-through-python-api
>
> Could somebody help me since I'm not a well-familiar with yum
> internals - what did I miss? Interestingly but setting
> "yb.conf.gpgcheck = False" doesn't make any difference at all. It
> still fails with the stacktrace above.
>
> --
> With best regards, Peter Lemenkov.

I've found it by myself. I forgot to add an equivalent of -y command
line switch. E.g. I need to add

yb.conf.assumeyes = True

--
With best regards, Peter Lemenkov.
_______________________________________________
Yum mailing list
Yum@xxxxxxxxxxxxxxxxx
http://lists.baseurl.org/mailman/listinfo/yum




[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux