Don't parse of sispmctl output (doesn't work)

This commit is contained in:
Martin Bauer 2020-07-13 11:33:18 +00:00
parent 349861ad7c
commit b4f8f24785
1 changed files with 9 additions and 8 deletions

View File

@ -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):