-
Notifications
You must be signed in to change notification settings - Fork 375
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
Report message in handler heartbeat #2688
Conversation
azurelinuxagent/ga/exthandlers.py
Outdated
@@ -1001,6 +1001,7 @@ def report_ext_handler_status(self, vm_status, ext_handler, goal_state_changed): | |||
heartbeat = ext_handler_i.collect_heartbeat() | |||
if heartbeat is not None: | |||
handler_status.status = heartbeat.get('status') | |||
handler_status.message = parse_formatted_message(heartbeat.get('formattedMessage')) |
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 should check that the heartbeat actually has a 'formattedMessage')
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 do we need extra check. The get call would handle if it's not available. It will return None if property does not present and same applies to status field.
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.
@nagworld9 we need the check so that we do not assign None to these properties
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.
I see. At this point we are overriding the handler status file content with heartbeat not with default None values. So makes sense to check here.
Codecov Report
@@ Coverage Diff @@
## develop #2688 +/- ##
===========================================
+ Coverage 71.98% 72.01% +0.03%
===========================================
Files 104 104
Lines 15748 15750 +2
Branches 2241 2242 +1
===========================================
+ Hits 11336 11343 +7
+ Misses 3896 3892 -4
+ Partials 516 515 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Description
This PR updates the agent to report the extension handler heartbeat message. Previously, any message in heartbeat.log was ignored.
Issue #
PR information
Quality of Code and Contribution Guidelines