def __init__(self):
     self._utils = utilsfactory.get_hypervutils()
     self._sg_gen = SecurityGroupRuleGeneratorR2()
     self._sec_group_rules = {}
     self._security_ports = {}
     self._sg_members = {}
     self._sg_rule_templates = {}
     self.cache_lock = threading.Lock()
Beispiel #2
0
    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._utils = utilsfactory.get_hypervutils()
        self._utils.init_caches()
        self._network_vswitch_map = {}
        self._port_metric_retries = {}

        self.plugin_rpc = None
        self.context = None
        self.client = None
        self.connection = None
        self.endpoints = None
        self.topic = constants.AGENT_TOPIC

        self._nvgre_enabled = False

        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._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)

        self._load_physical_network_mappings(self._phys_net_map)
    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._utils = utilsfactory.get_hypervutils()
        self._utils.init_caches()
        self._network_vswitch_map = {}
        self._port_metric_retries = {}

        self.plugin_rpc = None
        self.context = None
        self.client = None
        self.connection = None
        self.endpoints = None
        self.topic = constants.AGENT_TOPIC

        self._nvgre_enabled = False

        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._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)

        self._load_physical_network_mappings(self._phys_net_map)
    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_hypervutils()
        self._nvgre_utils = utils_nvgre.NvgreUtils()
        self._n_client = neutron_client.NeutronAPIClient()

        self._init_nvgre(physical_networks)
    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_hypervutils()
        self._nvgre_utils = utils_nvgre.NvgreUtils()
        self._n_client = neutron_client.NeutronAPIClient()

        self._init_nvgre(physical_networks)
Beispiel #6
0
 def _test_returned_class(self, expected_class, force_v1, os_version):
     CONF.hyperv.force_hyperv_utils_v1 = force_v1
     utilsfactory._get_windows_version = mock.MagicMock(
         return_value=os_version)
     actual_class = type(utilsfactory.get_hypervutils())
     self.assertEqual(actual_class, expected_class)
 def __init__(self):
     self._utils = utilsfactory.get_hypervutils()
     self._security_ports = {}
 def __init__(self):
     self._utils = utilsfactory.get_hypervutils()
     self._security_ports = {}
 def __init__(self):
     self._utils = utilsfactory.get_hypervutils()
     self._sg_gen = SecurityGroupRuleGeneratorR2()
     self._sec_group_rules = {}
     self._security_ports = {}
Beispiel #10
0
 def __init__(self):
     self._utils = utilsfactory.get_hypervutils()
     self._sg_gen = SecurityGroupRuleGeneratorR2()
     self._sec_group_rules = {}
     self._security_ports = {}