Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use gpg's --batch in apt-key adv during repo key add #50972



None yet
3 participants
Copy link

commented Dec 23, 2018

What does this PR do?

Changes salt.modules.aptpkg to use GPG's --batch flag for apt-key adv commands.

What issues does this PR fix or reference?

#50634 - GPG is attempting to write to a TTY, but can't do so in Salt's session. --batch puts GPG in a mode that is more suitable for unattended operation / automation.

Previous Behavior

          ID: nginx_official_repo
    Function: pkgrepo.managed
        Name: deb stretch nginx
      Result: False
     Comment: Failed to configure repo 'deb stretch nginx': Error: key retrieval failed: Executing: /tmp/apt-key-gpghome.fZfaKZHKx8/ --keyserver --logger-fd 1 --recv-keys ABF5BD827BD9BF62
              gpg: cannot open '/dev/tty': No such device or address
     Started: 11:18:11.681418
    Duration: 1549.853 ms

New Behavior

          ID: nginx_official_repo
    Function: pkgrepo.managed
        Name: deb stretch nginx
      Result: True
     Comment: Configured package repo 'deb stretch nginx'
     Started: 17:53:01.389656
    Duration: 3977.938 ms
                  deb stretch nginx

Tests written?


Commits signed with GPG?


Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

It looks like this could be fixed in Debian soon-ish, but maybe it is worth it for Salt to use --batch for GPG commands to ensure regressions don't cause issues here?

pirogoeth added some commits Dec 22, 2018

@garethgreenaway garethgreenaway requested a review from saltstack/team-core Jan 3, 2019

@garethgreenaway garethgreenaway merged commit 4685e0e into saltstack:2018.3 Jan 3, 2019

8 of 10 checks passed

jenkins/pr/py2-windows-2016 running py2-windows-2016...
jenkins/pr/py3-windows-2016 running py3-windows-2016...
WIP Ready for review
continuous-integration/jenkins/pr-merge This commit looks good
jenkins/pr/docs The docs job has passed
jenkins/pr/lint Python lint test has passed
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed

@pirogoeth pirogoeth deleted the pirogoeth:sjohn/2018.3-apt-key-batch branch Jan 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.