def addHost(self, name=None):
        '''
        Add a new host node to the topology.
        '''
        if name is None:
            while True:
                name = 'h' + str(self.__hnum)
                self.__hnum += 1
                if name not in self.__nxgraph:
                    break
        self.__addNode(name, Host)
        return name
def addHost ( self , name = None ) : if name is None : while True : name = 'h' + str ( self . __hnum ) self . __hnum += 1 if name not in self . __nxgraph : break self . __addNode ( name , Host ) return name
Add a new host node to the topology.