rest_client.py

updated for connection error case
This commit is contained in:
av1nxsh 2021-03-02 15:45:16 +05:30 committed by GitHub
parent 95c635091e
commit 218d22ed52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,7 +176,9 @@ class FtRestClient():
def ping(self):
"""simple ping"""
if self.show_config()['state'] == "running":
if not self.show_config():
return {"status": "not_running"}
elif self.show_config()['state'] == "running":
return {"status": "pong"}
else:
return {"status": "not_running"}