def __init__(self): """Initializes local configuration of the current agent. :param conf: dict or dict-like object containing the configuration details used by this Agent. If None is specified, default values are used instead. """ self._agent_id = None self._topic = topics.AGENT self._cache_lock = threading.Lock() self._refresh_cache = False self._host = CONF.get("host") self._agent_state = {} self._context = neutron_context.get_admin_context_without_session() self._utils = utilsfactory.get_networkutils() self._utils.init_caches() # The following attributes will be initialized by the # `_setup_rpc` method. self._client = None self._connection = None self._endpoints = [] self._plugin_rpc = None self._sg_plugin_rpc = None self._state_rpc = None agent_config = CONF.get("AGENT", {}) self._polling_interval = agent_config.get('polling_interval', 2)
def __init__(self, context): super(HyperVTrunkDriver, self).__init__() self._context = context self._utils = utilsfactory.get_networkutils() self._trunk_rpc = trunk_rpc.TrunkStub() # Map between trunk.id and trunk. self._trunks = {}
def _netutils(self): if not self._netutils_prop: # NOTE(claudiub): we're importing utilsfactory here in order to # avoid circular dependencies. from os_win import utilsfactory self._netutils_prop = utilsfactory.get_networkutils() return self._netutils_prop
def __init__(self, conf=None): """Initializes local configuration of the Hyper-V Neutron Agent. :param conf: dict or dict-like object containing the configuration details used by this Agent. If None is specified, default values are used instead. conf format is as follows: { 'host': string, 'AGENT': {'polling_interval': int, 'local_network_vswitch': string, 'physical_network_vswitch_mappings': array, 'enable_metrics_collection': boolean, 'metrics_max_retries': int}, 'SECURITYGROUP': {'enable_security_group': boolean} } For more information on the arguments, their meaning and their default values, visit: http://docs.openstack.org/juno/config-reference/content/ networking-plugin-hyperv_agent.html """ super(HyperVNeutronAgentMixin, self).__init__() self._metricsutils = utilsfactory.get_metricsutils() self._utils = utilsfactory.get_networkutils() self._utils.init_caches() self._network_vswitch_map = {} self._port_metric_retries = {} self._nvgre_enabled = False self._cache_lock = threading.Lock() conf = conf or {} agent_conf = conf.get('AGENT', {}) security_conf = conf.get('SECURITYGROUP', {}) self._host = conf.get('host', None) self._polling_interval = agent_conf.get('polling_interval', 2) self._local_network_vswitch = agent_conf.get('local_network_vswitch', 'private') self._worker_count = agent_conf.get('worker_count') self._phys_net_map = agent_conf.get( 'physical_network_vswitch_mappings', []) self.enable_metrics_collection = agent_conf.get( 'enable_metrics_collection', False) self._metrics_max_retries = agent_conf.get('metrics_max_retries', 100) self.enable_security_groups = security_conf.get( 'enable_security_group', False) tpool.set_num_threads(self._worker_count) self._load_physical_network_mappings(self._phys_net_map) self._init_nvgre()
def __init__(self, physical_networks): self.topic = constants.AGENT_TOPIC self._vswitch_ips = {} self._tunneling_agents = {} self._nvgre_ports = [] self._network_vsids = {} self._hyperv_utils = utilsfactory.get_networkutils() self._nvgre_utils = utilsfactory.get_nvgreutils() self._n_client = neutron_client.NeutronAPIClient() self._init_nvgre(physical_networks)
def __init__(self): self._utils = utilsfactory.get_networkutils() self._sg_gen = SecurityGroupRuleGeneratorR2() self._sec_group_rules = {} self._security_ports = {} self._sg_members = {} self._sg_rule_templates = {} self.cache_lock = threading.Lock() # TODO(claudiub): remove this on the next os-win release. clear_cache = lambda port_id: self._utils._sg_acl_sds.pop(port_id) self._utils.clear_port_sg_acls_cache = clear_cache
def __init__(self, conf=None): """Initializes local configuration of the Hyper-V Neutron Agent. :param conf: dict or dict-like object containing the configuration details used by this Agent. If None is specified, default values are used instead. conf format is as follows: { 'host': string, 'AGENT': {'polling_interval': int, 'local_network_vswitch': string, 'physical_network_vswitch_mappings': array, 'enable_metrics_collection': boolean, 'metrics_max_retries': int}, 'SECURITYGROUP': {'enable_security_group': boolean} } For more information on the arguments, their meaning and their default values, visit: http://docs.openstack.org/juno/config-reference/content/ networking-plugin-hyperv_agent.html """ super(HyperVNeutronAgentMixin, self).__init__() self._metricsutils = utilsfactory.get_metricsutils() self._utils = utilsfactory.get_networkutils() self._utils.init_caches() self._network_vswitch_map = {} self._port_metric_retries = {} self._nvgre_enabled = False self._cache_lock = threading.Lock() conf = conf or {} agent_conf = conf.get('AGENT', {}) security_conf = conf.get('SECURITYGROUP', {}) self._host = conf.get('host', None) self._polling_interval = agent_conf.get('polling_interval', 2) self._local_network_vswitch = agent_conf.get('local_network_vswitch', 'private') self._worker_count = agent_conf.get('worker_count') self._phys_net_map = agent_conf.get( 'physical_network_vswitch_mappings', []) self.enable_metrics_collection = agent_conf.get( 'enable_metrics_collection', False) self._metrics_max_retries = agent_conf.get('metrics_max_retries', 100) self.enable_security_groups = security_conf.get( 'enable_security_group', False) tpool.set_num_threads(self._worker_count) self._load_physical_network_mappings(self._phys_net_map)
def __init__(self): self._utils = utilsfactory.get_networkutils() self._sg_gen = SecurityGroupRuleGeneratorR2() self._sec_group_rules = {} self._security_ports = {} self._sg_members = {} self._sg_rule_templates = {} self.cache_lock = threading.Lock() # TODO(claudiub): remove this on the next os-win release. clear_cache = lambda port_id: self._utils._sg_acl_sds.pop(port_id, None) self._utils.clear_port_sg_acls_cache = clear_cache
def __init__(self): self._netutils = utilsfactory.get_networkutils()
def __init__(self): self._netutils = utilsfactory.get_networkutils()
def __init__(self): self._netutils = utilsfactory.get_networkutils() if nova.network.is_neutron(): self._vif_plugin = HyperVNeutronVIFPlugin() else: self._vif_plugin = HyperVNovaNetworkVIFPlugin()
def __init__(self): self._netutils = utilsfactory.get_networkutils() if nova.network.is_neutron(): self._vif_plugin = HyperVNeutronVIFPlugin() else: self._vif_plugin = HyperVNovaNetworkVIFPlugin()