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
Logging a disable error instead of Download error on extension update… #1616
Conversation
… failures due to disable cmd
Codecov Report
@@ Coverage Diff @@
## develop #1616 +/- ##
==========================================
Coverage ? 66.17%
==========================================
Files ? 78
Lines ? 11175
Branches ? 1578
==========================================
Hits ? 7395
Misses ? 3445
Partials ? 335
Continue to review full report at Codecov.
|
azurelinuxagent/ga/exthandlers.py
Outdated
@@ -436,6 +436,9 @@ def handle_ext_handler(self, ext_handler, etag): | |||
else: | |||
message = u"Unknown ext handler state:{0}".format(state) | |||
raise ExtensionError(message) | |||
except ExtensionUpdateError as e: | |||
# Only setting the handler status here as the error has already been reported from the old version | |||
ext_handler_i.set_handler_status(message=ustr(e), code=e.code) |
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.
this works fine now, but if we ever add/change logic in handle_ext_handler_error (which currently is the central place to handle errors) we may miss this one... consider adding a flag to handle_ext_handler_error to do/not do the logging and call it from here as well.
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.
Makes sense, I'll modify the code
if ext_handler_i.version_gt(old_ext_handler_i): | ||
ext_handler_i.update() | ||
else: | ||
old_ext_handler_i.update(version=ext_handler_i.ext_handler.properties.version) |
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.
wow! we support extension downgrade?
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.
Haha yes, this is at par with Windows. Not sure how much its been tested though.
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.
would you open a work item to test it and double-check whether the extension publishers doc talks about this? i'm sure some extensions publishers will be surprised (let's also check whether the VERSION env variable is documented). Thanks!
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.
Opened a task. Will follow up later about this
Successful DCR run for this PR - Successful DCR Run |
azurelinuxagent/ga/exthandlers.py
Outdated
:param op: Which operation to run | ||
""" | ||
try: | ||
if op == WALAEventOperation.Disable: |
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.
suggestion: if you pass a lambda then you don't need the switch on operation code
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.
Nice! Didnt know about it, will implement it!
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.
Left some suggestions, but LGTM. If you update the code let me know and I can take a look.
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.
You've already addressed my comments, thanks! LGTM
@larohra last set of changes LGTM |
… failures due to disable cmd
Description
This PR is for handling the case where failure of disable.cmd in update scenario would now log from the old extension version and not the new one
Issue #
PR information
Quality of Code and Contribution Guidelines
This change is