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
fix: Handle systemctl when dbus not ready #4842
Conversation
See commit d29b744, but this commit generalizes the solution for all calls in status.py
@@ -93,6 +93,36 @@ class StatusDetails(NamedTuple): | |||
{description}""" | |||
|
|||
|
|||
def query_systemctl( |
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 a good utility function to generalize interaction with systemctl. While we see other call-sites throughout cloud-init to systemctl in cloudini/net/network_manager, cloudinit/net/activators.py, cloudinit/sources/helpers/azure.py and cloudinit/config/cc_mounts.py, these entry points are much later in boot than a potential early-boot invocation of cloud-init status from external consumers. So I don't necessarily think we "need" this logic elsewhere for this PR. It may be worth generalizing it in util or somewhere if we find another call-site that warrants early boot interaction and exposure to the socket not yet being responsive.
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 current implementation is very status specific as well. So I don't think it's worth generalizing further at this time.
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.
+1 and minor unittest fix. Both otherwise looks good to me.
@TheRealFalcon please add the footer LP: #2046483 to the commit message when squashed/rebase merged. |
Co-authored-by: Chad Smith <chad.smith@canonical.com>
a0b449b
to
c8dea59
Compare
See commit d29b744, but this commit generalizes the solution for all calls in status.py LP: #2046483
See commit d29b744, but this commit generalizes the solution for all calls in status.py LP: #2046483
Proposed Commit Message
Additional Context
#4681 #4676 LP: #2046483
Test Steps
Checklist
Merge type