(self)
| 32 | |
| 33 | |
| 34 | def get_existing_agents(self) -> Dict[str, List[int]]: |
| 35 | existing_agents = defaultdict(list) |
| 36 | |
| 37 | while True: |
| 38 | resp = self.send("LIST AGNT") |
| 39 | parts = resp.split() |
| 40 | port = int(parts[0]) |
| 41 | kind = parts[1] |
| 42 | |
| 43 | if port in existing_agents[kind]: |
| 44 | return existing_agents |
| 45 | else: |
| 46 | existing_agents[kind].append(port) |