-
Notifications
You must be signed in to change notification settings - Fork 271
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
fix the status check of service in cluster #1166
Conversation
Signed-off-by: Tianle Huang <tianleh@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #1166 +/- ##
=========================================
Coverage 93.75% 93.75%
Complexity 10 10
=========================================
Files 103 103
Lines 2563 2563
Branches 9 9
=========================================
Hits 2403 2403
Misses 150 150
Partials 10 10
Continue to review full report at Codecov.
|
@@ -68,7 +68,7 @@ def get_service_response(self): | |||
def service_alive(self): | |||
response = self.get_service_response() | |||
logging.info(f"{response.status_code}: {response.text}") | |||
if response.status_code == 200 and ('"status":"green"' or '"status":"yellow"' in response.text): | |||
if response.status_code == 200 and (('"status":"green"' in response.text) or ('"status":"yellow"' in response.text)): |
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.
The service response is a JSON. To future proof this, there should be a class that wraps it, and exposes it’s properties, including an .alive
method.
Signed-off-by: Tianle Huang tianleh@amazon.com
Description
fix the status check of service in cluster
Issues Resolved
Resolves #1165
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.