def get_host_ip(self, name): """Returns the IP to a host name. Args: name: host's name """ ip = self.hosts_ip_mapping.get("nameToIp", {}).get(name, None) if ip: return ip raise NodeDoesNotExist(name)
def _node(self, node): """ Returns node's information Args: node: node's name Raises: NodeDoesNotExist: if node's name does not exist in the topology """ try: return self._network[node] except KeyError: raise NodeDoesNotExist(node)
def _node(self, node): try: return self._network[node] except KeyError: raise NodeDoesNotExist(node)