Load all the information regarding the physical network.
19322
def _load_physical_network_mappings(self, phys_net_vswitch_mappings):
        """"""
        for mapping in phys_net_vswitch_mappings:
            parts = mapping.split(':')
            if len(parts) != 2:
                LOG.debug('Invalid physical network mapping: %s', mapping)
            else:
                pattern = re.escape(parts[0].strip()).replace('\\*', '.*')
                pattern = pattern + '$'
                vswitch = parts[1].strip()
                self._physical_network_mappings[pattern] = vswitch
56944
async def info(self):
        """
        {'MasterCapability': 9, 'TransportPort': 3975}
        """
        act = self.service.action("X_GetDeviceInfo")
        res = await act.async_call()
        return res
1134815
def load(self):
        
        for i in range(1, self.bands + 1):
            self.__data[i - 1] = self.matrix(i)
933553
async def load_saved_device_info(self):
        """"""
        _LOGGER.debug("Loading saved device info.")
        deviceinfo = []
        if self._workdir:
            _LOGGER.debug("Really Loading saved device info.")
            try:
                device_file = '{}/{}'.format(self._workdir, DEVICE_INFO_FILE)
                with open(device_file, 'r') as infile:
                    try:
                        deviceinfo = json.load(infile)
                        _LOGGER.debug("Saved device file loaded")
                    except json.decoder.JSONDecodeError:
                        _LOGGER.debug("Loading saved device file failed")
            except FileNotFoundError:
                _LOGGER.debug("Saved device file not found")
        for device in deviceinfo:
            self._add_saved_device_info(**device)
280446
def _setup(self):
        """"""
        agent_config = CONF.get("AGENT", {})
        self._worker_count = agent_config.get('worker_count')
        self._phys_net_map = agent_config.get(
            'physical_network_vswitch_mappings', [])
        self._local_network_vswitch = agent_config.get(
            'local_network_vswitch')
        self._load_physical_network_mappings(self._phys_net_map)
        self._validate_vswitches()

        self._endpoints.append(self)
        self._event_callback_pairs.extend([
            (self._utils.EVENT_TYPE_CREATE, self._process_added_port_event),
            (self._utils.EVENT_TYPE_DELETE, self._process_removed_port_event)
        ])

        tpool.set_num_threads(self._worker_count)
704296
def process_raw_data(cls, raw_data):
        """"""
        properties = raw_data["properties"]

        raw_content = properties.get("addressSpace", None)
        if raw_content is not None:
            address_space = AddressSpace.from_raw_data(raw_content)
            properties["addressSpace"] = address_space

        raw_content = properties.get("dhcpOptions")
        if raw_content is not None:
            dhcp_options = DHCPOptions.from_raw_data(raw_content)
            properties["dhcpOptions"] = dhcp_options

        raw_content = properties.get("logicalNetwork", None)
        if raw_content is not None:
            properties["logicalNetwork"] = Resource.from_raw_data(raw_content)

        subnetworks = []
        for raw_subnet in properties.get("subnets", []):
            raw_subnet["parentResourceID"] = raw_data["resourceId"]
            subnetworks.append(SubNetworks.from_raw_data(raw_subnet))
        properties["subnets"] = subnetworks

        return super(VirtualNetworks, cls).process_raw_data(raw_data)
870833
def add_info_from_hv(self):
        
        # Router Image
        if 'image' in self.hypervisor:
            self.node['properties']['image'] = \
                os.path.basename(self.hypervisor['image'])
        # IDLE-PC
        if 'idlepc' in self.hypervisor:
            self.node['properties']['idlepc'] = self.hypervisor['idlepc']
        # Router RAM
        if 'ram' in self.hypervisor:
            self.node['properties']['ram'] = self.hypervisor['ram']
        # 7200 NPE
        if 'npe' in self.hypervisor:
            self.device_info['npe'] = self.hypervisor['npe']
        # Device Chassis
        if 'chassis' in self.hypervisor:
            self.device_info['chassis'] = self.hypervisor['chassis']
            if self.device_info['model'] == 'c3600':
                self.node['properties']['chassis'] = \
                    self.device_info['chassis']
793367
def load_data(self, pdbid):
        """"""
        f = urlopen("http://projects.biotec.tu-dresden.de/plip-rest/pdb/%s?format=xml" % pdbid.lower())
        self.doc = etree.parse(f)
45517
def process_raw_data(cls, raw_data):
        """"""
        properties = raw_data.get("properties", {})

        bgp_peers = []
        for raw_content in properties.get("bgpPeers", []):
            raw_content["parentResourceID"] = raw_data["resourceId"]
            raw_content["grandParentResourceID"] = raw_data["parentResourceID"]
            bgp_peers.append(BGPPeers.from_raw_data(raw_content))
        properties["bgpPeers"] = bgp_peers

        return super(BGPRouters, cls).process_raw_data(raw_data)
533082
def _load():
        
        with open(NetstatCollector.PROC_TCP, 'r') as f:
            content = f.readlines()
            content.pop(0)
        return content
244771
def process_raw_data(cls, raw_data):
        """"""
        properties = raw_data["properties"]

        subnetworks = []
        for raw_subnet in properties.get("subnets", []):
            raw_subnet["parentResourceID"] = raw_data["resourceId"]
            subnetworks.append(LogicalSubnetworks.from_raw_data(raw_subnet))
        properties["subnets"] = subnetworks

        virtual_networks = []
        for raw_network in properties.get("virtualNetworks", []):
            virtual_networks.append(Resource.from_raw_data(raw_network))
        properties["virtualNetworks"] = virtual_networks

        return super(LogicalNetworks, cls).process_raw_data(raw_data)
654488
def process_raw_data(cls, raw_data):
        """"""
        properties = raw_data["properties"]

        routes = []
        raw_routes = properties.get("routes", [])
        for raw_route in raw_routes:
            raw_route["parentResourceID"] = raw_data["resourceId"]
            routes.append(Routes.from_raw_data(raw_route))
        properties["routes"] = routes

        subnets = []
        raw_subnets = properties.get("subnets", [])
        for raw_subnet in raw_subnets:
            subnets.append(Resource.from_raw_data(raw_subnet))
        properties["subnets"] = subnets

        return super(RouteTables, cls).process_raw_data(raw_data)
933457
def load(self):
        """"""
        app = util.import_app("dallinger.experiment_server.sockets:app")
        if self.options.get("mode") == "debug":
            app.debug = True
        return app
105737
def _network_show(self, name, network_lst):
        '''
        
        '''
        for net in network_lst:
            if net.label == name:
                return net.__dict__
        return {}
1264012
def load(self):
        """"""
        self._list = self._source.load()
        self._list_iter = itertools.cycle(self._list)
246723
def load(self):
        
        with switch_db(StreamDefinitionModel, 'hyperstream'):
            self.mongo_model = StreamDefinitionModel.objects.get(__raw__=self.stream_id.as_raw())
            self._calculated_intervals = self.mongo_model.get_calculated_intervals()
230563
def load(self):
        """"""
        basepath = os.path.dirname(os.path.abspath(__file__))
        filename = os.sep.join([basepath, c.FOLDER_JSON, c.FILE_GAME_VERSIONS])
        Handler.ALL_VERS_DATA = {} # reset known data; do not retain defunct information
        with open(filename, "r") as f:
            data = json.loads( f.read() )
        self.update(data)
        self._updated = False