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

Do not report restart_if warnings as errors #1498

Merged
merged 1 commit into from
Mar 28, 2019

Conversation

narrieta
Copy link
Member

Intermittent failures resetting the network interface show routinely in automation runs.

shellutil.run always logs command failures as ERROR, when a failure of this specific command should be a warning (unless the number of retries is exceeded).


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and Travis.CI is passing.

Quality of Code and Contribution Guidelines

@narrieta narrieta requested review from vrdmr and pgombar March 28, 2019 19:09
@codecov-io
Copy link

Codecov Report

Merging #1498 into develop will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1498   +/-   ##
========================================
  Coverage    60.82%   60.82%           
========================================
  Files           75       75           
  Lines        10878    10878           
  Branches      1559     1559           
========================================
  Hits          6617     6617           
  Misses        3946     3946           
  Partials       315      315
Impacted Files Coverage Δ
azurelinuxagent/common/utils/shellutil.py 47.16% <100%> (ø) ⬆️
azurelinuxagent/common/osutil/default.py 53.78% <100%> (ø) ⬆️

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 ff01b37...8a7e119. Read the comment docs.

Copy link
Contributor

@pgombar pgombar left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this

@@ -1116,7 +1116,7 @@ def set_dhcp_hostname(self, hostname):
def restart_if(self, ifname, retries=3, wait=5):
retry_limit=retries+1
for attempt in range(1, retry_limit):
return_code=shellutil.run("ifdown {0} && ifup {0}".format(ifname))
return_code=shellutil.run("ifdown {0} && ifup {0}".format(ifname), expected_errors=[1] if attempt < retries else [])
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add spacing around return_code=shellutil.run(...)

@narrieta narrieta merged commit 4c7c892 into Azure:develop Mar 28, 2019
@narrieta narrieta deleted the netiface_error branch March 28, 2019 21:48
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