Don't parse of sispmctl output (doesn't work)
This commit is contained in:
parent
349861ad7c
commit
b4f8f24785
|
@ -49,20 +49,21 @@ class SispmctlHost:
|
|||
async with self._session.get(url, timeout=3) as resp:
|
||||
if resp.status == 200:
|
||||
result = await resp.json()
|
||||
await self.notify_switches(result)
|
||||
#await self.notify_switches(result)
|
||||
else:
|
||||
await self.set_switches_unreachable()
|
||||
except ClientConnectionError:
|
||||
await self.set_switches_unreachable()
|
||||
|
||||
async def update_state(self):
|
||||
url = f"http://{self.hostname}:{self.port}"
|
||||
async with self._session.get(url, timeout=3) as resp:
|
||||
if resp.status == 200:
|
||||
result = await resp.json()
|
||||
await self.notify_switches(result)
|
||||
else:
|
||||
await self.set_switches_unreachable()
|
||||
pass
|
||||
#url = f"http://{self.hostname}:{self.port}"
|
||||
#async with self._session.get(url, timeout=3) as resp:
|
||||
# if resp.status == 200:
|
||||
# result = await resp.json()
|
||||
# await self.notify_switches(result)
|
||||
# else:
|
||||
# await self.set_switches_unreachable()
|
||||
|
||||
async def notify_switches(self, response):
|
||||
for i, switch in enumerate(self._switch_objects):
|
||||
|
|
Loading…
Reference in New Issue