Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
 def _node(self, node):
     try:
         return self._network[node]
     except KeyError:
         raise NodeDoesNotExist(node)