support for aiohttp 2.0
@@ -38,6 +38,8 @@ def gen_hello_msg():
if resthelper_loaded:
ips = resthelper.get_local_ips()
host_info['local-addresses'] = ips
+ else:
+ logging.warning('Local addresses not available')
hello_msg = json.dumps({"input": host_info})
return hello_msg
@@ -63,13 +65,13 @@ async def controller_announce():
try:
async with session.post(PM.CONTROLLER_REST, data=gen_hello_msg(),
headers={'content-type': 'application/json'}) as resp:
- logging.debug(
- 'announce addr: %s:%s' % resp.connection._protocol.transport.get_extra_info('sockname'))
+ # logging.debug('announce addr: %s:%s' % resp.connection._protocol.transport.get_extra_info('sockname'))
assert resp.status == 200
html = await resp.text()
# logging.debug(html)
- except (ValueError, aiohttp.errors.ClientOSError) as e:
+ # aiohttp.errors.ClientOSError not suported in aiohttp 2.0 TODO https://github.com/jwilk/urlycue/commit/e18179c771c1e594cc6701605d3e8a6de07e1189
+ except (ValueError) as e:
print(e)
await asyncio.sleep(sleep_time)
