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

Handle exceptions in containers when setting sysctl keys #460

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

andrewdmcleod
Copy link
Contributor

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.

check_call(call)
except CalledProcessError as e:
if is_container():
print("Error setting some systcl keys in this container: {}".format(e.output))
Copy link
Collaborator

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.

check_call(call)
except CalledProcessError as e:
if is_container():
log("Error setting some systcl keys in this container: {}".format(e.output),
Copy link
Collaborator

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.

@ajkavanagh ajkavanagh requested a review from javacruft September 1, 2021 10:59
@ajkavanagh ajkavanagh dismissed javacruft’s stale review September 1, 2021 10:59

It looks like the changes have been addressed.

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.

2 participants