async def get_all_gpos(self): try: async for gpo in self.ldap.get_all_gpos(): g = JackDawADGPO.from_adgpo(gpo) await self.agent_out_q.coro_put((LDAPAgentCommand.GPO, g)) del g except: await self.agent_out_q.coro_put((LDAPAgentCommand.EXCEPTION, str(traceback.format_exc()))) finally: await self.agent_out_q.coro_put((LDAPAgentCommand.GPOS_FINISHED, None))
def get_all_gpos(self): try: for gpo in self.ldap.get_all_gpos(): self.agent_out_q.put( (LDAPAgentCommand.GPO, JackDawADGPO.from_adgpo(gpo))) except Exception as e: self.agent_out_q.put( (LDAPAgentCommand.EXCEPTION, str(traceback.format_exc()))) finally: self.agent_out_q.put((LDAPAgentCommand.GPOS_FINISHED, None))