Preventing '/dev/tty not found' problems (#49950)

* Preventing '/dev/tty not found' problems when ' apt_repository` calls GPG in order to import keys.
pull/50898/head
Manuel Molina Cuberos 6 years ago committed by Sam Doran
parent 91522bd9c4
commit 3b5ac77a16

@ -0,0 +1,2 @@
bugfixes:
- apt_repository - do not require a tty to prevent errors parsing GPG keys (https://github.com/ansible/ansible/issues/49949)

@ -430,7 +430,7 @@ class UbuntuSourcesList(SourcesList):
if self.add_ppa_signing_keys_callback is not None:
info = self._get_ppa_info(ppa_owner, ppa_name)
if not self._key_already_exists(info['signing_key_fingerprint']):
command = ['apt-key', 'adv', '--recv-keys', '--keyserver', 'hkp://keyserver.ubuntu.com:80', info['signing_key_fingerprint']]
command = ['apt-key', 'adv', '--recv-keys', '--no-tty', '--keyserver', 'hkp://keyserver.ubuntu.com:80', info['signing_key_fingerprint']]
self.add_ppa_signing_keys_callback(command)
file = file or self._suggest_filename('%s_%s' % (line, self.codename))

Loading…
Cancel
Save