mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 11:48:03 +00:00
tip_station_powersave.py: adds new way of testing for no results
This commit is contained in:
@@ -197,7 +197,8 @@ class TIPStationPowersave(LFCliBase):
|
|||||||
|
|
||||||
print("Collecting lanforge eth0 IP...")
|
print("Collecting lanforge eth0 IP...")
|
||||||
eth0_resp = self.json_get("/port/1/%s/eth0?fields=port,alias,ip"%self.resource, debug_=self.debug)
|
eth0_resp = self.json_get("/port/1/%s/eth0?fields=port,alias,ip"%self.resource, debug_=self.debug)
|
||||||
if (eth0_resp is None) or ("items" in eth0_resp) or ("interface" not in eth0_resp):
|
# would be nice to have a not_found() kind of method
|
||||||
|
if (eth0_resp is None) or ("items" in eth0_resp) or ("empty" in eth0_resp) or ("interface" not in eth0_resp):
|
||||||
self._fail("Unable to query %s.eth0"%self.resource, print_=True)
|
self._fail("Unable to query %s.eth0"%self.resource, print_=True)
|
||||||
exit(1)
|
exit(1)
|
||||||
self.eth0_ip = eth0_resp["interface"]["ip"]
|
self.eth0_ip = eth0_resp["interface"]["ip"]
|
||||||
|
|||||||
Reference in New Issue
Block a user