daemon/core/session.py
def handledistributedcontrolnet(self, msg, values, idx):
        ''' Modify Config Message if multiple control network prefixes are
        defined. Map server names to prefixes and repack the message before
        it is forwarded to slave servers.
        '''
        kv = values[idx]
        key, value = kv.split('=', 1)
        controlnets = value.split()
        if len(controlnets) < 2:
            return # multiple controlnet prefixes do not exist
        servers = self.session.broker.getserverlist()
        if len(servers) < 2:
            return # not distributed
        servers.remove("localhost")
        servers.insert(0, "localhost") # master always gets first prefix
        # create list of "server1:ctrlnet1 server2:ctrlnet2 ..."
        controlnets = map(lambda(x): "%s:%s" % (x[0],x[1]),
                          zip(servers, controlnets))
        values[idx] = "controlnet=%s" % (' '.join(controlnets))
        values_str = '|'.join(values)
        msg.tlvdata[coreapi.CORE_TLV_CONF_VALUES] = values_str
        msg.repack()
 Modify Config Message if multiple control network prefixes are
        defined. Map server names to prefixes and repack the message before
        it is forwarded to slave servers.
        
Modify Config Message if multiple control network prefixes are
defined. Map server names to prefixes and repack the message before
it is forwarded to slave servers.
Modify Config Message if multiple control network prefixes are defined . Map server names to prefixes and repack the message before it is forwarded to slave servers .
def handledistributedcontrolnet(self, msg, values, idx):
        kv = values[idx]
        key, value = kv.split('=', 1)
        controlnets = value.split()
        if len(controlnets) < 2:
            return 
        servers = self.session.broker.getserverlist()
        if len(servers) < 2:
            return 
        servers.remove("localhost")
        servers.insert(0, "localhost") 
        controlnets = map(lambda(x): "%s:%s" % (x[0],x[1]),
                          zip(servers, controlnets))
        values[idx] = "controlnet=%s" % (' '.join(controlnets))
        values_str = '|'.join(values)
        msg.tlvdata[coreapi.CORE_TLV_CONF_VALUES] = values_str
        msg.repack()
def handledistributedcontrolnet ( self , msg , values , idx ) : kv = values [ idx ] key , value = kv . split ( '=' , 1 ) controlnets = value . split ( ) if len ( controlnets ) < 2 : return servers = self . session . broker . getserverlist ( ) if len ( servers ) < 2 : return servers . remove ( "localhost" ) servers . insert ( 0 , "localhost" ) controlnets = map ( lambda ( x ) : "%s:%s" % ( x [ 0 ] , x [ 1 ] ) , zip ( servers , controlnets ) ) values [ idx ] = "controlnet=%s" % ( ' ' . join ( controlnets ) ) values_str = '|' . join ( values ) msg . tlvdata [ coreapi . CORE_TLV_CONF_VALUES ] = values_str msg . repack ( )
Modify Config Message if multiple control network prefixes are
defined.
Modify Config Message if multiple control network prefixes are defined .
''' Modify Config Message if multiple control network prefixes are
        defined. Map server names to prefixes and repack the message before
        it is forwarded to slave servers.
        ''' # multiple controlnet prefixes do not exist # not distributed # master always gets first prefix # create list of "server1:ctrlnet1 server2:ctrlnet2 ..."
self
msg
values
idx