← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1813396] Re: gpg called without no-tty

 

This bug is believed to be fixed in cloud-init in version 20.4. If this
is still a problem for you, please make a comment and set the state back
to New

Thank you.

** Changed in: cloud-init
       Status: Confirmed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1813396

Title:
  gpg called without no-tty

Status in cloud-init:
  Fix Released

Bug description:
  I am running cloud-init on a libvirt/virsh with this image:
  https://cdimage.debian.org/cdimage/openstack/archive/9.6.5-20190122/debian-9.6.5-20190122
  -openstack-amd64.qcow2

  the relevant lines are:
  apt:
    sources:
     docker:
       source: 'deb [arch=amd64] https://download.docker.com/linux/debian stretch stable'
       keyserver: keyserver.ubuntu.com
       keyid: 0EBFCD88

  sorry for not attaching any bugs, but the triggered command just does
  not find "/dev/tty")

  The gpg wrapper should have the "no-tty" argument for receiving key at least on debian systems.
  Otherwise cloudinit fails when specifying key-ids on debian cloudimages (with manually added dirmngr and apt-transport-https, it is quite a mess on the openstack debian images...) 

  I would naively propose the following patch:

  diff --git a/cloudinit/gpg.py b/cloudinit/gpg.py
  index 7fe17a2..21d598e 100644
  --- a/cloudinit/gpg.py
  +++ b/cloudinit/gpg.py
  @@ -42,7 +42,7 @@ def recv_key(key, keyserver, retries=(1, 1)):
       @param retries: an iterable of sleep lengths for retries.
                       Use None to indicate no retries."""
       LOG.debug("Importing key '%s' from keyserver '%s'", key, keyserver)
  -    cmd = ["gpg", "--keyserver=%s" % keyserver, "--recv-keys", key]
  +    cmd = ["gpg", "--no-tty", "--keyserver=%s" % keyserver, "--recv-keys", key]
       if retries is None:
           retries = []
       trynum = 0

  BR

  Till

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1813396/+subscriptions


References