-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fixes #32309 - pulpcore-manager fails from certain directories #181
Fixes #32309 - pulpcore-manager fails from certain directories #181
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself makes sense to me. However, please make the commit message more descriptive. Like Always run admin cmds from Pulp's home
(not sure how much will fit). Ideally with then a body that describes that the cwd might be an unreadable directory like /root
and dynaconf appears to unconditionally read the current directory. Pulp's user home should always be readable for the user pulp.
Also, it might be good to link to a dynaconf bugreport. IMHO it shouldn't error out on unreadable CWD.
manifests/admin.pp
Outdated
@@ -32,11 +35,13 @@ | |||
String $user = $pulpcore::user, | |||
Stdlib::Absolutepath $pulp_settings = $pulpcore::settings_file, | |||
Optional[Integer[0]] $timeout = undef, | |||
String $working_dir = $pulpcore::user_home, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to be stricter, even if it doesn't really make a difference.
String $working_dir = $pulpcore::user_home, | |
Stdlib::Absolutepath $working_dir = $pulpcore::user_home, |
aec9bcb
to
c56861f
Compare
Not sure yet why the tests are complaining about |
In that testcase we don't include the class puppet-pulpcore/spec/defines/admin_spec.rb Lines 9 to 15 in 9f680a1
|
c56861f
to
2bf597e
Compare
@ekohl I think we're all good now. |
@@ -11,6 +11,7 @@ | |||
{ | |||
pulp_settings: '/etc/pulpcore/settings.py', | |||
user: 'pulpcore', | |||
working_dir: '/var/lib/pulp' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ianballou , could you please add to the test below, under is_expected.to contain_exec('pulpcore-manager help')
,
.with_cwd('/var/lib/pulp')
This way we are not only passing the param from the parent module which pulpcore::admin
needs, we are also testing that the feature works properly at the business logic level (puppet catalogue) and continues working as expected with any future changes.
* Dynaconf seems to always be using the current directory. As such, the cwd could be a directory that is unreadable by the pulp user. Pulp's user home must always be readable by the pulp user.
2bf597e
to
bf40b19
Compare
@wbclark okay, I added the test condition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I would have written as well
FWIW, tried to fix, this helped https://github.com/rochacbruno/dynaconf/pull/570 |
Sets a specific directory for pulpcore-manager to be called from.