add disable_sudo_conntrack option for network integration#4746
Closed
stonith wants to merge 1 commit into
Closed
Conversation
hithwen
reviewed
Oct 11, 2019
stonith
force-pushed
the
no_sudo_docker
branch
from
October 11, 2019 20:14
3aa8f8b to
3a475ce
Compare
stonith
force-pushed
the
no_sudo_docker
branch
2 times, most recently
from
October 11, 2019 23:27
a842290 to
3436430
Compare
stonith
force-pushed
the
no_sudo_docker
branch
from
October 11, 2019 23:43
3436430 to
36618be
Compare
Contributor
|
Hallo, thanks for addressing the comments. We are currently on a code freeze but we'll come back as soon as its over. |
therve
suggested changes
Oct 23, 2019
therve
left a comment
Contributor
There was a problem hiding this comment.
Thanks for your patch, some minor comments.
|
|
||
| # Get the conntrack -S information | ||
| conntrack_path = instance.get('conntrack_path') | ||
| disable_sudo_conntrack = instance.get('disable_sudo_conntrack', False) |
Contributor
There was a problem hiding this comment.
Suggested change
| disable_sudo_conntrack = instance.get('disable_sudo_conntrack', False) | |
| disable_sudo_conntrack = is_affirmative(instance.get('disable_sudo_conntrack', False)) |
| if disable_sudo_conntrack is True: | ||
| output, _, _ = get_subprocess_output([conntrack_path, "-S"], self.log) | ||
| else: | ||
| output, _, _ = get_subprocess_output(["sudo", conntrack_path, "-S"], self.log) |
Contributor
There was a problem hiding this comment.
I'd write it a bit differently:
cmd = [conntrack_path, "-S"]
if use_sudo:
cmd.insert(0, "sudo")
output, _, _ = get_subprocess_output(cmd, self.log)
And then pass not disable_sudo_contrack as argument instead.
4 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add
disable_sudo_conntrackoption to disable sudo when running conntrack -SMotivation
sudo is generally not available in containers and conntrack can be run without it
Review checklist (to be filled by reviewers)
changelog/andintegration/labels attached