daemon/core/session.py
def updatectrlifhosts(self, netidx=0, remove=False):
        ''' Add the IP addresses of control interfaces to the /etc/hosts file.
        '''
        if not self.getcfgitembool('update_etc_hosts', False):
            return
        
        try:
            ctrlnet = self.getctrlnetobj(netidx)
        except KeyError:
            return
        header = "CORE session %s host entries" % self.sessionid
        if remove:
            if self.getcfgitembool('verbose', False):
                self.info("Removing /etc/hosts file entries.")
            filedemunge('/etc/hosts', header)
            return
        entries = []
        for ifc in ctrlnet.netifs():
            name = ifc.node.name
            for addr in ifc.addrlist:
                entries.append("%s %s" % (addr.split('/')[0], ifc.node.name))
        if self.getcfgitembool('verbose', False):
            self.info("Adding %d /etc/hosts file entries." % len(entries))
        filemunge('/etc/hosts', header, '\n'.join(entries) + '\n')
 Add the IP addresses of control interfaces to the /etc/hosts file.
        
Add the IP addresses of control interfaces to the /etc/hosts file.
Add the IP addresses of control interfaces to the / etc / hosts file .
def updatectrlifhosts(self, netidx=0, remove=False):
        if not self.getcfgitembool('update_etc_hosts', False):
            return
        try:
            ctrlnet = self.getctrlnetobj(netidx)
        except KeyError:
            return
        header = "CORE session %s host entries" % self.sessionid
        if remove:
            if self.getcfgitembool('verbose', False):
                self.info("Removing /etc/hosts file entries.")
            filedemunge('/etc/hosts', header)
            return
        entries = []
        for ifc in ctrlnet.netifs():
            name = ifc.node.name
            for addr in ifc.addrlist:
                entries.append("%s %s" % (addr.split('/')[0], ifc.node.name))
        if self.getcfgitembool('verbose', False):
            self.info("Adding %d /etc/hosts file entries." % len(entries))
        filemunge('/etc/hosts', header, '\n'.join(entries) + '\n')
def updatectrlifhosts ( self , netidx = 0 , remove = False ) : if not self . getcfgitembool ( 'update_etc_hosts' , False ) : return try : ctrlnet = self . getctrlnetobj ( netidx ) except KeyError : return header = "CORE session %s host entries" % self . sessionid if remove : if self . getcfgitembool ( 'verbose' , False ) : self . info ( "Removing /etc/hosts file entries." ) filedemunge ( '/etc/hosts' , header ) return entries = [ ] for ifc in ctrlnet . netifs ( ) : name = ifc . node . name for addr in ifc . addrlist : entries . append ( "%s %s" % ( addr . split ( '/' ) [ 0 ] , ifc . node . name ) ) if self . getcfgitembool ( 'verbose' , False ) : self . info ( "Adding %d /etc/hosts file entries." % len ( entries ) ) filemunge ( '/etc/hosts' , header , '\n' . join ( entries ) + '\n' )
Add the IP addresses of control interfaces to the /etc/hosts file.
Add the IP addresses of control interfaces to the / etc / hosts file .
''' Add the IP addresses of control interfaces to the /etc/hosts file.
        '''
self
netidx
remove