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

pirogoeth
Copy link
Contributor

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?

@garethgreenaway garethgreenaway requested a review from a team January 3, 2019 01:55
@garethgreenaway garethgreenaway merged commit 4685e0e into saltstack:2018.3 Jan 3, 2019
@pirogoeth pirogoeth deleted the sjohn/2018.3-apt-key-batch branch January 3, 2019 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants