本文整理汇总了Python中neutron.common.utils.get_hostname函数的典型用法代码示例。如果您正苦于以下问题:Python get_hostname函数的具体用法?Python get_hostname怎么用?Python get_hostname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_hostname函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, conf, controllertype):
super(OpenFlowController, self).__init__(conf, controllertype)
self.cfg = conf
self.controllertype = controllertype
self.ctx = context.get_admin_context()
self.hostname = utils.get_hostname()
self.sync_active_state = False
self.sync_all = True
self.l3_app = None
self.heartbeat = None
self.open_flow_hand = None
开发者ID:CingHu,项目名称:dragonflow,代码行数:11,代码来源:openflow_controller.py
示例2: __init__
def __init__(self, host=None):
if host is None:
host = neutron_utils.get_hostname()
super(ApicTopologyService, self).__init__(host=host)
self.apic_manager = ma.APICMechanismDriver.get_apic_manager(False)
self.peers = {}
self.conf = cfg.CONF.ml2_cisco_apic
self.conn = None
self.invalid_peers = []
self.dispatcher = None
self.state = None
self.state_agent = None
self.topic = arpc.TOPIC_APIC_SERVICE
开发者ID:cotsog,项目名称:apic-ml2-driver,代码行数:14,代码来源:apic_topology.py
示例3: __init__
def __init__(self, host=None):
if host is None:
host = neutron_utils.get_hostname()
super(ApicTopologyAgent, self).__init__(host=host)
self.conf = cfg.CONF.ml2_cisco_apic
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.service_agent = ApicTopologyServiceNotifierApi()
self.state = None
self.state_agent = None
self.topic = TOPIC_APIC_SERVICE
self.uplink_ports = []
self.invalid_peers = []
开发者ID:bradleyjones,项目名称:neutron,代码行数:18,代码来源:apic_topology.py
示例4: duration
cfg.IntOpt('max_dns_nameservers', default=5,
help=_("Maximum number of DNS nameservers")),
cfg.IntOpt('max_subnet_host_routes', default=20,
help=_("Maximum number of host routes per subnet")),
cfg.IntOpt('max_fixed_ips_per_port', default=5,
help=_("Maximum number of fixed ips per port")),
cfg.IntOpt('dhcp_lease_duration', default=86400,
deprecated_name='dhcp_lease_time',
help=_("DHCP lease duration (in seconds). Use -1 to tell "
"dnsmasq to use infinite lease times.")),
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")),
cfg.StrOpt('host', default=utils.get_hostname(),
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('force_gateway_on_subnet', default=True,
help=_("Ensure that configured gateway is on subnet. "
"For IPv6, validate only if gateway is not a link "
"local address. Deprecated, to be removed during the "
"K release, at which point the check will be "
"mandatory.")),
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.")),
开发者ID:insequent,项目名称:neutron,代码行数:31,代码来源:config.py
示例5:
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, "
"automatically trigger 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")),
]
router_opts = [
cfg.MultiStrOpt('tenant_default_router_rule', default=['*:any:any:permit'],
help=_("The default router rules installed in new tenant "
"routers. Repeat the config option for each rule. "
"Format is <tenant>:<source>:<destination>:<action>"
" Use an * to specify default for all tenants.")),
cfg.IntOpt('max_router_rules', default=200,
help=_("Maximum number of router rules")),
]
开发者ID:50infivedays,项目名称:neutron,代码行数:31,代码来源:config.py
示例6:
help=_("The username and password for authenticating against " " the BigSwitch or Floodlight controller."),
),
cfg.BoolOpt(
"server_ssl",
default=False,
help=_("If True, Use SSL when connecting to the BigSwitch or " "Floodlight controller."),
),
cfg.BoolOpt("sync_data", default=False, help=_("Sync data on connect")),
cfg.IntOpt(
"server_timeout",
default=10,
help=_("Maximum number of seconds to wait for proxy request " "to connect and complete."),
),
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.CONF.register_opts(restproxy_opts, "RESTPROXY")
router_opts = [
cfg.MultiStrOpt(
开发者ID:Brocade-OpenSource,项目名称:OpenStack-DNRM-Neutron,代码行数:31,代码来源:plugin.py
示例7: duration
cfg.IntOpt("max_fixed_ips_per_port", default=5, help=_("Maximum number of fixed ips per port")),
cfg.IntOpt(
"dhcp_lease_duration",
default=86400,
deprecated_name="dhcp_lease_time",
help=_("DHCP lease duration (in seconds). Use -1 to tell " "dnsmasq to use infinite lease times."),
),
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")),
cfg.StrOpt(
"host",
default=utils.get_hostname(),
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(
"force_gateway_on_subnet",
default=True,
help=_(
"Ensure that configured gateway is on subnet. "
"For IPv6, validate only if gateway is not a link "
"local address. Deprecated, to be removed during the "
"K release, at which point the check will be "
开发者ID:hzhou8,项目名称:neutron,代码行数:31,代码来源:config.py
示例8: _sync_routers_task
def _sync_routers_task(self, context):
LOG.debug(_("Starting _sync_routers_task - fullsync:%s"),
self.fullsync)
if not self.fullsync:
return
try:
self.local_ip, self.dvr_base_mac, self.priority = self.agent_rpc.get_init_info(context, uts.get_hostname())
LOG.debug(_("sync task:local_ip is %s, dvr_base_mac is %s, priority is %s"),
self.local_ip, self.dvr_base_mac, self.priority)
# rebuild default flows
self.tun_br.remove_all_flows()
self.gw_br.remove_all_flows()
self.setup_tunnel_flows()
self.setup_gateway_flows()
self.setup_default_flows()
try:
self.keepalived_pro = KeepalivedProcess(self.root_helper, self.local_ip, self.priority, conf=self.conf)
self.keepalived_pro.create_keepalived_cfg()
self.keepalived_pro.start_keepalived()
except Exception, e:
LOG.error(_("start keepalived failed : %s"), e)
if self.routersync:
timestamp = timeutils.utcnow()
# l3_agent will send vm_ip_mac while get_routers
routers = self.agent_rpc.get_routers(context)
LOG.debug(_('Processing :%r'), routers)
for r in routers:
if not r.get("ext_net_info"):
continue
subnets = r.get("subnets")
for subnet in subnets:
temp = copy.deepcopy(r)
temp["subnets"] = [subnet]
update = RouterUpdate(r.get("router_id"),
PRIORITY_SYNC_ROUTERS_TASK,
temp,
action=self.ROUTER_INTERFACE_ADD,
timestamp=timestamp)
self._queue.add(update)
routes = r.get("routes")
for route in routes:
temp = copy.deepcopy(r)
temp["routes"] = [route]
temp["subnets"] = []
update = RouterUpdate(r.get("router_id"),
PRIORITY_SYNC_ROUTERS_TASK,
temp,
action=self.ROUTER_ROUTE_ADD,
timestamp=timestamp)
self._queue.add(update)
self.fullsync = False
LOG.debug(_("_sync_routers_task successfully completed"))
开发者ID:HybridCloud-dew,项目名称:hws,代码行数:62,代码来源:l3_data_engine.py
注:本文中的neutron.common.utils.get_hostname函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论