Set event loop in case of RuntimeError, fixes provisioning in Packet
@@ -207,7 +207,12 @@ def _list_async(driver):
result = yield from future
retval.extend(result)
return retval""" % resource_type, glob, loc)
+ try:
+ loop = asyncio.get_event_loop()
+ except RuntimeError:
+ asyncio.set_event_loop(asyncio.new_event_loop())
loop = asyncio.get_event_loop()
+
return loop.run_until_complete(loc['_list_async'](loc['self']))
def ex_list_nodes_for_project(self, ex_project_id, include='plan', page=1,
