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

Merged

Conversation

Projects
None yet
3 participants
@pirogoeth
Copy link
Contributor

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 http://nginx.org/packages/debian/ stretch nginx
      Result: False
     Comment: Failed to configure repo 'deb http://nginx.org/packages/debian/ stretch nginx': Error: key retrieval failed: Executing: /tmp/apt-key-gpghome.fZfaKZHKx8/gpg.1.sh --keyserver keyserver.ubuntu.com --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
     Changes:

New Behavior

          ID: nginx_official_repo
    Function: pkgrepo.managed
        Name: deb http://nginx.org/packages/debian/ stretch nginx
      Result: True
     Comment: Configured package repo 'deb http://nginx.org/packages/debian/ stretch nginx'
     Started: 17:53:01.389656
    Duration: 3977.938 ms
     Changes:
              ----------
              repo:
                  deb http://nginx.org/packages/debian stretch nginx

Tests written?

No

Commits signed with GPG?

Yes

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

@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.