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

Use run_command for ip route #1958

Merged
merged 2 commits into from
Jul 23, 2020
Merged

Use run_command for ip route #1958

merged 2 commits into from
Jul 23, 2020

Conversation

narrieta
Copy link
Member

ip route was using run/run_get_output

@codecov
Copy link

codecov bot commented Jul 22, 2020

Codecov Report

Merging #1958 into develop will decrease coverage by 0.07%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             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              
Impacted Files Coverage Δ
azurelinuxagent/common/osutil/default.py 58.32% <0.00%> (-0.88%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6de8cf6...84dc12d. Read the comment docs.

Copy link
Contributor

@larohra larohra left a 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)
Copy link
Contributor

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.

Copy link
Member Author

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

Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

@narrieta narrieta merged commit 7bdc95e into Azure:develop Jul 23, 2020
@narrieta narrieta deleted the ip-route branch July 24, 2020 20:18
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.

3 participants