def __init__(self, host=None): if host is None: host = net_utils.get_hostname() super(ApicTopologyAgent, self).__init__(host=host) self.conf = cfg.CONF.apic_host_agent self.count_current = 0 self.count_force_send = AGENT_FORCE_UPDATE_COUNT self.interfaces = {} self.lldpcmd = None self.peers = {} self.port_desc_re = map(re.compile, ACI_PORT_DESCR_FORMATS) self.port_local_re = re.compile(ACI_PORT_LOCAL_FORMAT) self.vpcport_desc_re = re.compile(ACI_VPCPORT_DESCR_FORMAT) self.chassis_desc_re = re.compile(ACI_CHASSIS_DESCR_FORMAT) self.service_agent = arpc.ApicTopologyServiceNotifierApi() self.state = None self.state_agent = None self.topic = arpc.TOPIC_APIC_SERVICE self.uplink_ports = [] self.invalid_peers = []
default='openstacklocal', help=_('Domain to use for building the hostnames')), cfg.StrOpt('external_dns_driver', help=_('Driver for external DNS integration.')), cfg.BoolOpt('dhcp_agent_notification', default=True, help=_("Allow sending resource operation" " notification to DHCP agent")), cfg.BoolOpt('allow_overlapping_ips', default=False, help=_("Allow overlapping IP support in Neutron. " "Attention: the following parameter MUST be set to " "False if Neutron is being used in conjunction with " "Nova security groups.")), cfg.StrOpt('host', default=net.get_hostname(), sample_default='example.domain', help=_("Hostname to be used by the Neutron server, agents and " "services running on this machine. All the agents and " "services running on this machine must use the same " "host value.")), cfg.BoolOpt('notify_nova_on_port_status_changes', default=True, help=_("Send notification to nova when port status changes")), cfg.BoolOpt('notify_nova_on_port_data_changes', default=True, help=_("Send notification to nova when port data (fixed_ips/" "floatingip) changes so nova can update its cache.")), cfg.IntOpt('send_events_interval', default=2, help=_('Number of seconds between sending events to nova if '
help=_("DHCP lease duration (in seconds). Use -1 to tell " "dnsmasq to use infinite lease times.")), cfg.StrOpt('dns_domain', default='openstacklocal', help=_('Domain to use for building the hostnames')), cfg.StrOpt('external_dns_driver', help=_('Driver for external DNS integration.')), cfg.BoolOpt('dhcp_agent_notification', default=True, help=_("Allow sending resource operation" " notification to DHCP agent")), cfg.BoolOpt('allow_overlapping_ips', default=False, help=_("Allow overlapping IP support in Neutron. " "Attention: the following parameter MUST be set to " "False if Neutron is being used in conjunction with " "Nova security groups.")), cfg.HostAddressOpt('host', default=net.get_hostname(), sample_default='example.domain', help=_("Hostname to be used by the Neutron server, " "agents and services running on this machine. " "All the agents and services running on this " "machine must use the same host value.")), cfg.StrOpt("network_link_prefix", help=_("This string is prepended to the normal URL that is " "returned in links to the OpenStack Network API. If it " "is empty (the default), the URLs are returned " "unchanged.")), cfg.BoolOpt('notify_nova_on_port_status_changes', default=True, help=_("Send notification to nova when port status changes")), cfg.BoolOpt('notify_nova_on_port_data_changes', default=True, help=_("Send notification to nova when port data (fixed_ips/" "floatingip) changes so nova can update its cache.")),
def get_hostname(): return net.get_hostname()
help=_("Sync data on connect")), cfg.BoolOpt('auto_sync_on_failure', default=True, help=_("If neutron fails to create a resource because " "the backend controller doesn't know of a dependency, " "the plugin automatically triggers a full data " "synchronization to the controller.")), cfg.IntOpt('consistency_interval', default=60, help=_("Time between verifications that the backend controller " "database is consistent with Neutron")), cfg.IntOpt('server_timeout', default=10, help=_("Maximum number of seconds to wait for proxy request " "to connect and complete.")), cfg.IntOpt('thread_pool_size', default=4, help=_("Maximum number of threads to spawn to handle large " "volumes of port creations.")), cfg.StrOpt('neutron_id', default='neutron-' + utils.get_hostname(), deprecated_name='quantum_id', help=_("User defined identifier for this Neutron deployment")), cfg.BoolOpt('add_meta_server_route', default=True, help=_("Flag to decide if a route to the metadata server " "should be injected into the VM")), cfg.StrOpt('zenic_version', default="50.1", help=_("Version number of the zenic controller corresponding " "to the zenic agent")), cfg.StrOpt('up_gw_status', default="True", help=_("up gwport status bind to router")), cfg.StrOpt('op_version', default="", help=_("Version number of the zenic plugins")), cfg.StrOpt('sync_router', default="False", help=_("Flag to decide if plugin use sync router function")), ]
def test_get_hostname(self, mock_gethostname): self.assertEqual('fake-host-name', net.get_hostname()) mock_gethostname.assert_called_once_with()
help=_("DHCP lease duration (in seconds). Use -1 to tell " "dnsmasq to use infinite lease times.")), cfg.StrOpt('dns_domain', default='openstacklocal', help=_('Domain to use for building the hostnames')), cfg.StrOpt('external_dns_driver', help=_('Driver for external DNS integration.')), cfg.BoolOpt('dhcp_agent_notification', default=True, help=_("Allow sending resource operation" " notification to DHCP agent")), cfg.BoolOpt('allow_overlapping_ips', default=False, help=_("Allow overlapping IP support in Neutron. " "Attention: the following parameter MUST be set to " "False if Neutron is being used in conjunction with " "Nova security groups.")), cfg.StrOpt('host', default=net.get_hostname(), sample_default='example.domain', help=_("Hostname to be used by the Neutron server, agents and " "services running on this machine. All the agents and " "services running on this machine must use the same " "host value.")), cfg.BoolOpt('notify_nova_on_port_status_changes', default=True, help=_("Send notification to nova when port status changes")), cfg.BoolOpt('notify_nova_on_port_data_changes', default=True, help=_("Send notification to nova when port data (fixed_ips/" "floatingip) changes so nova can update its cache.")), cfg.IntOpt('send_events_interval', default=2, help=_('Number of seconds between sending events to nova if ' 'there are any events to send.')), cfg.BoolOpt('advertise_mtu', default=True, deprecated_for_removal=True,
"the plugin automatically triggers a full data " "synchronization to the controller.")), cfg.IntOpt('consistency_interval', default=60, help=_("Time between verifications that the backend controller " "database is consistent with Neutron. (0 to disable)")), cfg.IntOpt('server_timeout', default=10, help=_("Maximum number of seconds to wait for proxy request " "to connect and complete.")), cfg.IntOpt('thread_pool_size', default=4, help=_("Maximum number of threads to spawn to handle large " "volumes of port creations.")), cfg.StrOpt('neutron_id', default='neutron-' + net.get_hostname(), deprecated_name='quantum_id', help=_("User defined identifier for this Neutron deployment")), cfg.BoolOpt('add_meta_server_route', default=True, help=_("Flag to decide if a route to the metadata server " "should be injected into the VM")), cfg.StrOpt('auth_url', help=_("Authentication URL")), cfg.StrOpt('auth_user', help=_("Admin username")), cfg.StrOpt('auth_password', help=_("Admin password")), cfg.StrOpt('auth_tenant', help=_("Admin tenant name")), cfg.IntOpt('keystone_sync_interval', default=300, help=_("Time between that keystone queries to sync " "Openstack tenants. (0 to disable)")), cfg.BoolOpt('sync_security_groups',
"the plugin automatically triggers a full data " "synchronization to the controller.")), cfg.IntOpt('consistency_interval', default=60, help=_("Time between verifications that the backend controller " "database is consistent with Neutron")), cfg.IntOpt('server_timeout', default=10, help=_("Maximum number of seconds to wait for proxy request " "to connect and complete.")), cfg.IntOpt('thread_pool_size', default=4, help=_("Maximum number of threads to spawn to handle large " "volumes of port creations.")), cfg.StrOpt('neutron_id', default='neutron-' + utils.get_hostname(), deprecated_name='quantum_id', help=_("User defined identifier for this Neutron deployment")), cfg.BoolOpt('add_meta_server_route', default=True, help=_("Flag to decide if a route to the metadata server " "should be injected into the VM")), cfg.StrOpt('zenic_version', default="50.1", help=_("Version number of the zenic controller corresponding " "to the ml2-plugin")), cfg.StrOpt('enable_qos', default="False", help=_("Flag to decide if plugin use qos function")), cfg.StrOpt('enable_M_qos', default="False",
help=_("Sync data on connect")), cfg.BoolOpt('auto_sync_on_failure', default=True, help=_("If neutron fails to create a resource because " "the backend controller doesn't know of a dependency, " "the plugin automatically triggers a full data " "synchronization to the controller.")), cfg.IntOpt('consistency_interval', default=60, help=_("Time between verifications that the backend controller " "database is consistent with Neutron. (0 to disable)")), cfg.IntOpt('server_timeout', default=10, help=_("Maximum number of seconds to wait for proxy request " "to connect and complete.")), cfg.IntOpt('thread_pool_size', default=4, help=_("Maximum number of threads to spawn to handle large " "volumes of port creations.")), cfg.StrOpt('neutron_id', default='neutron-' + net.get_hostname(), deprecated_name='quantum_id', help=_("User defined identifier for this Neutron deployment")), cfg.BoolOpt('add_meta_server_route', default=True, help=_("Flag to decide if a route to the metadata server " "should be injected into the VM")), cfg.StrOpt('auth_url', help=_("Authentication URL")), cfg.StrOpt('auth_user', help=_("Admin username")), cfg.StrOpt('auth_password', help=_("Admin password")), cfg.StrOpt('auth_tenant', help=_("Admin tenant name")), cfg.IntOpt('keystone_sync_interval', default=300, help=_("Time between that keystone queries to sync " "Openstack tenants. (0 to disable)")), ] router_opts = [ cfg.MultiStrOpt('tenant_default_router_rule', default=['*:any:any:permit'],