-
Notifications
You must be signed in to change notification settings - Fork 372
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
Use run_command for ip route #1958
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1958 +/- ##
===========================================
- Coverage 69.67% 69.59% -0.08%
===========================================
Files 85 85
Lines 11985 11998 +13
Branches 1677 1677
===========================================
Hits 8350 8350
- Misses 3263 3276 +13
Partials 372 372
Continue to review full report at Codecov.
|
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.
LGTM
chk_err=False) | ||
try: | ||
route_cmd = ["ip", "route", "add", "255.255.255.255", "dev", ifname] | ||
return shellutil.run_command(route_cmd) |
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.
Why is this method even returning? The callers do nothing with the return value.
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.
yes, i noticed that but won't fix it now. there are several implementations of the method
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.
It's an easy change since none of the callers do anything with the return value, but I won't block your PR for it, up to you.
return shellutil.run(cmd, chk_err=False) | ||
try: | ||
cmd = ["ip", "route", "add", net, "via", gateway] | ||
return shellutil.run_command(cmd) |
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.
Same comment here; return is not used anywhere.
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.
idem
ip route was using run/run_get_output