Skip to content

Commit

Permalink
rest_client.py
Browse files Browse the repository at this point in the history
optimised with var 'configstatus'
  • Loading branch information
av1nxsh authored Mar 2, 2021
1 parent 218d22e commit a85e656
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ def show_config(self):

def ping(self):
"""simple ping"""
if not self.show_config():
configstatus = self.show_config()
if not configstatus:
return {"status": "not_running"}
elif self.show_config()['state'] == "running":
elif configstatus['state'] == "running":
return {"status": "pong"}
else:
return {"status": "not_running"}
Expand Down

0 comments on commit a85e656

Please sign in to comment.