-
Notifications
You must be signed in to change notification settings - Fork 128
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
Handle exceptions in containers when setting sysctl keys #460
base: master
Are you sure you want to change the base?
Conversation
charmhelpers/core/sysctl.py
Outdated
check_call(call) | ||
except CalledProcessError as e: | ||
if is_container(): | ||
print("Error setting some systcl keys in this container: {}".format(e.output)) |
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.
Please can we use logging rather than just print here.
charmhelpers/core/sysctl.py
Outdated
check_call(call) | ||
except CalledProcessError as e: | ||
if is_container(): | ||
log("Error setting some systcl keys in this container: {}".format(e.output), |
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.
typo - sysctl (not systcl) and please can we log this as a warning - its not fatal so it not an error.
It looks like the changes have been addressed.
Prior to focal, when setting some sysctl keys in a container, sysctl returned an exit code of 0. Now, the same error returns a 255. This commit ensures the same behaviour as prior to focal.