-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
daemon-reload on call to service.avaliable #36538
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.
Looks good to me but would also like @terminalmage to have a look.
@clinta I feel like causing I've opened #36626 as a potential alternative. What this does is expose the Would you mind testing my alternate solution? |
@terminalmage: Sure, I'll put it in place and let you know. |
@terminalmage, This does work. However, with that fix I use |
This allows for us to check for unit file changes at the beginning of the available() function without invoking the available() function a second time, potentially resulting in a recursive loop if not handled delicately.
OK, I just thought of a middle ground. I opened a PR against your fork, see here: clinta#1 What this does is move the logic that checks to see if a unit is available to a separate function that |
Move check for service availability to a helper function
That looks perfect, and I tested and it works exactly as I expect. Thanks. |
Great, we'll wait for tests to complete and get this one merged. I've closed my alternative PR. |
What does this PR do?
Calls _check_for_unit_changes on service.avaliable
What issues does this PR fix or reference?
Related to #34927, but affecting the service.running with enable=true rather than the service.enable state.
Previous Behavior
The following state would automatically detect if a unit file existed and execute a daemon-reload if required to make the service available before enabling it.
But this similar state would not.
New Behavior
Both states listed above do daemon-reload before trying to enable the service if changes in the unit file are detected.
Tests written?
No
Please review Salt's Contributing Guide for best practices.