Skip to content

Commit 46fd01b

Browse files
committed
Replace to_string with string representation method for Health class
Use this to print health status. Signed-off-by: Bernd Hufmann <[email protected]>
1 parent 64ab0e6 commit 46fd01b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

tsp/health.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ def __init__(self, params):
5555
else:
5656
self.status = None
5757

58-
def to_string(self):
59-
'''
60-
to_string method
61-
'''
62-
return f"Health[status={self.status}]"
58+
59+
def __repr__(self):
60+
return f"Health(status={self.status})"

tsp_cli_client

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ if __name__ == "__main__":
583583
if options.get_health:
584584
response = tsp_client.fetch_health()
585585
if response.status_code == 200:
586-
print(' {0}'.format(response.model.to_string()))
586+
print(response.model)
587587
sys.exit(0)
588588
else:
589589
sys.exit(1)

0 commit comments

Comments
 (0)