def doCheckNetworkInterfaces(self, arg): dhnio.Dprint(4, 'network_connector.doCheckNetworkInterfaces') # TODO # self.automat('got-network-info', []) start_time = time.time() if dhnio.Linux(): def _call(): return dhnnet.getNetworkInterfaces() def _done(result, start_time): dhnio.Dprint(4, 'network_connector.doCheckNetworkInterfaces._done: %s in %d seconds' % (str(result), time.time()- start_time)) self.automat('got-network-info', result) d = threads.deferToThread(_call) d.addBoth(_done, start_time) else: ips = dhnnet.getNetworkInterfaces() dhnio.Dprint(4, 'network_connector.doCheckNetworkInterfaces DONE: %s in %d seconds' % (str(ips), time.time()- start_time)) self.automat('got-network-info', ips)
def _call(): return dhnnet.getNetworkInterfaces()