예제 #1
0
    def __init__(self, config):

        self.config = config

        node.__init__(self, self.config["NODE"])
        self.device = actuator_device(self.config["ACTDEV"])
        self.state = STATE_IDLE
예제 #2
0
    def __init__(self, config):

        self.config = config 

        node.__init__(self, self.config["NODE"])
        self.device = sensor_device(self.config["SENSDEV"])
        self.state      = STATE_IDLE        
예제 #3
0
파일: router.py 프로젝트: ykzeng/emuedge
	def __init__(self, did, name, ifs_json=None, nat_params=None, dhcp_params=None, neighbors=None):
		node.__init__(self, did, name, dtype=node_type.PROUTER)
		netns.__init__(self, name)
		if ifs_json!=None:
			self.init_ifs_json(ifs_json)
			if nat_params!=None and nat_params['is_open']==True:
				self.init_nat_json(nat_params)
			if dhcp_params!=None and dhcp_params['is_open']==True:
				self.init_dhcp_json(dhcp_params)
			if neighbors!=None:
				self.init_neighbors(neighbors)
		else:
			if nat_params['is_open'] or dhcp_params['is_open'] or neighbors!=None:
				log("must have ifs to open NAT/DHCP", logging.CRITICAL)
예제 #4
0
파일: xswitch.py 프로젝트: ykzeng/emuedge
    def __init__(self, session, did, name, default=False, uuid=""):
        if default:
            print "xswitch " + name + " get uuid: " + uuid
            self.br = session.xenapi.network.get_by_uuid(uuid)
            # ignore the passed name, get name from xenserver instead
            br_name = session.xenapi.network.get_bridge(self.br)
            log("default XSwitch " + name + " in Linux: " + br_name)
            node.__init__(self, did, br_name, node_type.SWITCH)
        else:
            br_args = {
                'assigned_ips': {},
                'name_label': name,
                'name_description': '',
                'MTU': '1500',
                'other_config': {},
                'blobs': {}
            }
            self.br = session.xenapi.network.create(br_args)
            br_name = session.xenapi.network.get_bridge(self.br)
            log("XSwitch " + name + " in Linux: " + br_name)
            node.__init__(self, did, br_name, node_type.SWITCH)

        self.default = default
예제 #5
0
    def __init__(self, name="", neighbors=None, _id=None, **kwargs):
        if _id is None and neighbors is None:
            node.__init__(self)
        elif _id is None:
            node.__init__(self, neighbors)
        else:
            node.__init__(self, neighbors, _id)

        self.name = name
        self.properties = kwargs or []
예제 #6
0
 def __init__(self, name, proxy):
     node.__init__(self, name, proxy)
     self.leader_name = None
     self.wait_time = 5
     self.sync_time_offset = 0
예제 #7
0
파일: dev.py 프로젝트: akrishna1995/emuedge
 def __init__(self, did, name, dtype=node_type.DEV):
     node.__init__(self, did, name, dtype)
     pass
예제 #8
0
 def __init__(self):
     node.__init__(self)
     #request.__init__(self)
     #higher_level.node_list_hl.append((self.id,self.ip_address))
     pass
예제 #9
0
    def __init__(self, config):
        
        self.config = config  

        node.__init__(self, self.config["NODE"])
예제 #10
0
 def __init__(self):
     node.__init__(self)
     lower_level.node_list_ll.append((self.id, self.ip_address))
     pass