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

(MODULES-3015) Fix SLES11 GPG key import issue #79

Merged
merged 2 commits into from
Feb 10, 2016

Conversation

glarizza
Copy link

Previously, the exec to import the Puppetlabs GPG key made a call out to the
gpg binary to gather the hex value of the Puppetlabs GPG key. This call works
from the console with an ENV, but it doesn't work when automated because it
cannot find the relative homedir (~/.gnupg). To work around this, explicitly
set the value for root's .gnupg homedir in the unless command and expose it as
a variable should we need to deal with it later.

@highb
Copy link
Contributor

highb commented Feb 1, 2016

@glarizza Looks like the lint checker doesn't like something about the indentation of the hashrockets? I'm not seeing it in the changes tab, what does it do when you run bundle install && bundle exec rake test locally?

Log for future readers:

manifests/osfamily/suse.pp - WARNING: indentation of => is not properly aligned on line 37
manifests/osfamily/suse.pp - WARNING: indentation of => is not properly aligned on line 38
manifests/osfamily/suse.pp - WARNING: indentation of => is not properly aligned on line 39
manifests/osfamily/suse.pp - WARNING: indentation of => is not properly aligned on line 40
manifests/osfamily/suse.pp - WARNING: indentation of => is not properly aligned on line 41

logoutput => 'on_failure',
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => "rpm --import ${gpg_path}",
unless => "rpm -q gpg-pubkey-$(echo $(gpg --homedir ${gpg_homedir} --throw-keyids < ${gpg_path}) | cut --characters=11-18 | tr [A-Z] [a-z])",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to come up with less painful variations to this line and not coming up with much.

There is a minimal change that I think would be helpful:

rpm -q gpg-pubkey-$(gpg --homedir ${gpg_homedir} --throw-keyids --with-colons < ${gpg_path} | cut -d: -f5 | tr [A-Z] [a-z])

Should at least get away from specifying the character positions (which I think were off by one). Also I /think/ the echo was unnecessary?

Previously, the exec to import the Puppetlabs GPG key made a call out to the
gpg binary to gather the hex value of the Puppetlabs GPG key. This call works
from the console with an ENV, but it doesn't work when automated because it
cannot find the relative homedir (~/.gnupg). To work around this, explicitly
set the value for root's .gnupg homedir in the unless command and expose it as
a variable should we need to deal with it later.
@highb highb force-pushed the MODULES_3015_sles_11_key_import branch from 5307fb4 to 63e6eb0 Compare February 10, 2016 18:35
Prior to this commit the specs were failing due to changes in
63e6eb0 to the SLES GPG key
handling.
This commit updates the specs to match those changes.
@highb
Copy link
Contributor

highb commented Feb 10, 2016

Alright, updated the specs, fixed the linter nonsense, specs ran fine. 👍 Thanks for the fix!

highb added a commit that referenced this pull request Feb 10, 2016
(MODULES-3015) Fix SLES11 GPG key import issue
@highb highb merged commit 9f53463 into puppetlabs:master Feb 10, 2016
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.

3 participants