check whether arg hostname exists or not

This commit is contained in:
ahmadbilalkhalid 2019-07-20 20:18:23 +05:00
parent a0a30f46ae
commit bc1854aa25
1 changed files with 4 additions and 0 deletions

View File

@ -222,6 +222,10 @@ def main():
args = argparser.parse_args()
host = client.get(args.hostname, value_in_json=True)
if not host:
print("No Such Host")
exit(1)
host.value["status"] = "ALIVE"
host.value["last_heartbeat"] = datetime.utcnow().isoformat()