本文整理汇总了Python中networking_cisco._i18n._LI函数的典型用法代码示例。如果您正苦于以下问题:Python _LI函数的具体用法?Python _LI怎么用?Python _LI使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_LI函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: dfa_uplink_restart
def dfa_uplink_restart(self, uplink_dict):
LOG.info(_LI("Obtained uplink after restart %s "), uplink_dict)
# This shouldn't happen
if self.phy_uplink is not None:
LOG.error(_LE("Uplink detection already done %s"), self.phy_uplink)
return
uplink = uplink_dict.get('uplink')
veth_intf = uplink_dict.get('veth_intf')
# Logic is as follows:
# If DB didn't have any uplink it means it's not yet detected or down
# if DB has uplink and veth, then no need to scan all ports we can
# start with this veth.
# If uplink has been removed or modified during restart, then a
# down will be returned by uplink detection code and it will be
# removed then.
# If DB has uplink, but no veth, it's an error condition and in
# which case remove the uplink port from bridge and start fresh
if uplink is None or len(uplink) == 0:
LOG.info(_LI("uplink not discovered yet"))
self.restart_uplink_called = True
return
if veth_intf is not None and len(veth_intf) != 0:
LOG.info(_LI("veth interface is already added, %(ul)s %(veth)s"),
{'ul': uplink, 'veth': veth_intf})
self.phy_uplink = uplink
self.veth_intf = veth_intf
self.restart_uplink_called = True
return
LOG.info(_LI("Error case removing the uplink %s from bridge"), uplink)
ovs_vdp.delete_uplink_and_flows(self.root_helper, self.br_ex, uplink)
self.restart_uplink_called = True
开发者ID:JoelCapitao,项目名称:networking-cisco,代码行数:31,代码来源:dfa_vdp_mgr.py
示例2: is_fw_drvr_create_needed
def is_fw_drvr_create_needed(self):
"""This API returns True if a driver init needs to be performed.
This returns True if a FW is created with a active policy that has
more than one rule associated with it and if a driver init is NOT
done.
"""
LOG.info(_LI("In Drvr create needed %(fw_created)s "
"%(active_policy_id)s"
" %(is_fw_drvr_created)s %(pol_present)s %(fw_type)s"),
{'fw_created': self.fw_created,
'active_policy_id': self.active_pol_id,
'is_fw_drvr_created': self.is_fw_drvr_created(),
'pol_present': self.active_pol_id in self.policies,
'fw_type': self.fw_type})
if self.active_pol_id is not None and (
self.active_pol_id in self.policies):
LOG.info(_LI("In Drvr create needed %(len_policy)s %(one_rule)s"),
{'len_policy':
len(self.policies[self.active_pol_id]['rule_dict']),
'one_rule':
self.one_rule_present(self.active_pol_id)})
return self.fw_created and self.active_pol_id and (
not self.is_fw_drvr_created()) and self.fw_type and (
self.active_pol_id in self.policies) and (
len(self.policies[self.active_pol_id]['rule_dict'])) > 0 and (
self.one_rule_present(self.active_pol_id))
开发者ID:noironetworks,项目名称:networking-cisco,代码行数:27,代码来源:fw_mgr.py
示例3: delete_hosting_device_resources
def delete_hosting_device_resources(self, context, tenant_id, mgmt_port,
**kwargs):
attempts = 1
port_ids = set(p['id'] for p in kwargs['ports'])
while mgmt_port is not None or port_ids:
if attempts == DELETION_ATTEMPTS:
LOG.warning(_LW('Aborting resource deletion after %d '
'unsuccessful attempts'), DELETION_ATTEMPTS)
return
else:
if attempts > 1:
eventlet.sleep(SECONDS_BETWEEN_DELETION_ATTEMPTS)
LOG.info(_LI('Resource deletion attempt %d starting'),
attempts)
# Remove anything created.
if mgmt_port is not None:
ml = {mgmt_port['id']}
self._delete_resources(context, "management port",
self._core_plugin.delete_port,
n_exc.PortNotFound, ml)
if not ml:
mgmt_port = None
self._delete_resources(context, "trunk port",
self._core_plugin.delete_port,
n_exc.PortNotFound, port_ids)
attempts += 1
self._safe_delete_t1_network(context, tenant_id)
self._safe_delete_t2_network(context, tenant_id)
LOG.info(_LI('Resource deletion succeeded'))
开发者ID:JoelCapitao,项目名称:networking-cisco,代码行数:30,代码来源:n1kv_ml2_trunking_driver.py
示例4: is_fw_complete
def is_fw_complete(self):
"""This API returns the completion status of FW.
This returns True if a FW is created with a active policy that has
more than one rule associated with it and if a driver init is done
successfully.
"""
LOG.info(_LI("In fw_complete needed %(fw_created)s "
"%(active_policy_id)s %(is_fw_drvr_created)s "
"%(pol_present)s %(fw_type)s"),
{'fw_created': self.fw_created,
'active_policy_id': self.active_pol_id,
'is_fw_drvr_created': self.is_fw_drvr_created(),
'pol_present': self.active_pol_id in self.policies,
'fw_type': self.fw_type})
if self.active_pol_id is not None:
LOG.info(_LI("In Drvr create needed %(len_policy)s %(one_rule)s"),
{'len_policy':
len(self.policies[self.active_pol_id]['rule_dict']),
'one_rule':
self.one_rule_present(self.active_pol_id)})
return self.fw_created and self.active_pol_id and (
self.is_fw_drvr_created()) and self.fw_type and (
self.active_pol_id in self.policies) and (
len(self.policies[self.active_pol_id]['rule_dict'])) > 0 and (
self.one_rule_present(self.active_pol_id))
开发者ID:noironetworks,项目名称:networking-cisco,代码行数:26,代码来源:fw_mgr.py
示例5: get_running_config_router_ids
def get_running_config_router_ids(self, parsed_cfg):
rconf_ids = []
is_multi_region_enabled = cfg.CONF.multi_region.enable_multi_region
if (is_multi_region_enabled):
vrf_regex_new = VRF_MULTI_REGION_REGEX_NEW
else:
vrf_regex_new = VRF_REGEX_NEW
for parsed_obj in parsed_cfg.find_objects(vrf_regex_new):
LOG.info(_LI("VRF object: %s"), (str(parsed_obj)))
match_obj = re.match(vrf_regex_new, parsed_obj.text)
router_id = match_obj.group(1)
LOG.info(_LI(" First 6 digits of router ID: %s\n"),
(router_id))
if (is_multi_region_enabled):
region_id = match_obj.group(2)
LOG.info(_LI(" region ID: %s\n"),
(region_id))
my_region_id = cfg.CONF.multi_region.region_id
if (my_region_id == region_id):
rconf_ids.append(router_id)
else:
rconf_ids.append(router_id)
return rconf_ids
开发者ID:JoelCapitao,项目名称:networking-cisco,代码行数:26,代码来源:asr1k_cfg_syncer.py
示例6: clean_vrfs
def clean_vrfs(self, conn, router_id_dict, parsed_cfg):
ostk_router_ids = self.get_ostk_router_ids(router_id_dict)
rconf_ids = self.get_running_config_router_ids(parsed_cfg)
source_set = set(ostk_router_ids)
dest_set = set(rconf_ids)
# add_set = source_set.difference(dest_set)
del_set = dest_set.difference(source_set)
LOG.info(_LI("VRF DB set: %s"), (source_set))
LOG.info(_LI("VRFs to delete: %s"), (del_set))
# LOG.info("VRFs to add: %s" % (add_set))
is_multi_region_enabled = cfg.CONF.multi_region.enable_multi_region
invalid_vrfs = []
for router_id in del_set:
if (is_multi_region_enabled):
my_region_id = cfg.CONF.multi_region.region_id
invalid_vrfs.append("nrouter-%s-%s" % (router_id,
my_region_id))
else:
invalid_vrfs.append("nrouter-%s" % (router_id))
if not self.test_mode:
for vrf_name in invalid_vrfs:
confstr = asr_snippets.REMOVE_VRF_DEFN % vrf_name
conn.edit_config(target='running', config=confstr)
return invalid_vrfs
开发者ID:JoelCapitao,项目名称:networking-cisco,代码行数:30,代码来源:asr1k_cfg_syncer.py
示例7: populate_local_cache
def populate_local_cache(self):
"""This populates the local cache after reading the Database.
It calls the appropriate rule create, fw create routines.
It doesn't actually call the routine to prepare the fabric or cfg the
device since it will be handled by retry module.
"""
fw_dict = self.get_all_fw_db()
LOG.info(_LI("Populating FW Mgr Local Cache"))
for fw_id in fw_dict:
fw_data = fw_dict.get(fw_id)
tenant_id = fw_data.get('tenant_id')
rule_dict = fw_data.get('rules').get('rules')
policy_id = fw_data.get('rules').get('firewall_policy_id')
for rule in rule_dict:
fw_evt_data = self.convert_fwdb_event_msg(rule_dict.get(rule),
tenant_id, rule,
policy_id)
LOG.info(_LI("Populating Rules for tenant %s"), tenant_id)
self.fw_rule_create(fw_evt_data, cache=True)
fw_os_data = self.os_helper.get_fw(fw_id)
# If enabler is stopped and FW is deleted, then the above routine
# will fail.
if fw_os_data is None:
fw_os_data = self.convert_fwdb(tenant_id, fw_data.get('name'),
policy_id, fw_id)
LOG.info(_LI("Populating FW for tenant %s"), tenant_id)
self.fw_create(fw_os_data, cache=True)
if fw_data.get('device_status') == 'SUCCESS':
self.fwid_attr[tenant_id].fw_drvr_created(True)
else:
self.fwid_attr[tenant_id].fw_drvr_created(False)
return fw_dict
开发者ID:noironetworks,项目名称:networking-cisco,代码行数:33,代码来源:fw_mgr.py
示例8: process_uplink_event
def process_uplink_event(self, msg, phy_uplink):
LOG.info(_LI("Received New uplink Msg %(msg)s for uplink %(uplink)s"),
{'msg': msg.get_status(), 'uplink': phy_uplink})
if msg.get_status() == 'up':
ovs_exc_raised = False
try:
self.ovs_vdp_obj_dict[phy_uplink] = ovs_vdp.OVSNeutronVdp(
phy_uplink, msg.get_integ_br(), msg.get_ext_br(),
msg.get_root_helper())
except Exception as exc:
LOG.error(_LE("OVS VDP Object creation failed %s"), str(exc))
ovs_exc_raised = True
if (ovs_exc_raised or not self.ovs_vdp_obj_dict[phy_uplink].
is_lldpad_setup_done()):
# Is there a way to delete the object??
LOG.error(_LE("UP Event Processing NOT Complete"))
self.err_que.enqueue(constants.Q_UPL_PRIO, msg)
else:
self.uplink_det_compl = True
veth_intf = (self.ovs_vdp_obj_dict[self.phy_uplink].
get_lldp_bridge_port())
LOG.info(_LI("UP Event Processing Complete Saving uplink "
"%(ul)s and veth %(veth)s"),
{'ul': self.phy_uplink, 'veth': veth_intf})
self.save_uplink(uplink=self.phy_uplink, veth_intf=veth_intf)
elif msg.get_status() == 'down':
# Free the object fixme(padkrish)
if phy_uplink in self.ovs_vdp_obj_dict:
self.ovs_vdp_obj_dict[phy_uplink].clear_obj_params()
else:
ovs_vdp.delete_uplink_and_flows(self.root_helper, self.br_ex,
phy_uplink)
self.save_uplink()
开发者ID:JoelCapitao,项目名称:networking-cisco,代码行数:33,代码来源:dfa_vdp_mgr.py
示例9: _set_default_mobility_domain
def _set_default_mobility_domain(self):
settings = self._get_settings()
LOG.info(_LI("settings is %s") % settings)
if ('globalMobilityDomain' in settings.keys()):
global_md = settings.get('globalMobilityDomain')
self._default_md = global_md.get('name')
LOG.info(_LI("setting default md to be %s") % self._default_md)
else:
self._default_md = "md0"
开发者ID:noironetworks,项目名称:networking-cisco,代码行数:10,代码来源:cisco_dfa_rest.py
示例10: process_err_queue
def process_err_queue(self):
LOG.info(_LI("Entered Err process_q"))
try:
while self.err_que.is_not_empty():
prio, msg = self.err_que.dequeue_nonblock()
msg_type = msg.msg_type
LOG.info(_LI("Msg dequeued from err queue type is %d"), msg_type)
if msg_type == constants.UPLINK_MSG_TYPE:
self.que.enqueue(constants.Q_UPL_PRIO, msg)
except Exception as e:
LOG.exceptin(_LE("Exception caught in proc_err_que %s "), str(e))
开发者ID:noironetworks,项目名称:networking-cisco,代码行数:11,代码来源:dfa_vdp_mgr.py
示例11: clean_acls
def clean_acls(self, conn, intf_segment_dict,
segment_nat_dict, parsed_cfg):
delete_acl_list = []
is_multi_region_enabled = cfg.CONF.multi_region.enable_multi_region
if (is_multi_region_enabled):
acl_regex = ACL_MULTI_REGION_REGEX
else:
acl_regex = ACL_REGEX
acls = parsed_cfg.find_objects(acl_regex)
for acl in acls:
LOG.info(_LI("\nacl: %(acl)s") % {'acl': acl})
match_obj = re.match(acl_regex, acl.text)
if (is_multi_region_enabled):
region_id = match_obj.group(1)
segment_id = match_obj.group(2)
if region_id != cfg.CONF.multi_region.region_id:
if region_id not in cfg.CONF.multi_region.other_region_ids:
delete_acl_list.append(acl.text)
else:
# skip because some other deployment owns
# this configuration
continue
else:
segment_id = match_obj.group(1)
segment_id = int(segment_id)
LOG.info(_LI(" segment_id: %(seg_id)s") % {'seg_id': segment_id})
# Check that segment_id exists in openstack DB info
if segment_id not in intf_segment_dict:
LOG.info(_LI("Segment ID not found, deleting acl"))
delete_acl_list.append(acl.text)
continue
# Check that permit rules match subnets defined on openstack intfs
if self.check_acl_permit_rules_valid(segment_id,
acl,
intf_segment_dict) is False:
delete_acl_list.append(acl.text)
continue
self.existing_cfg_dict['acls'][segment_id] = acl
if not self.test_mode:
for acl_cfg in delete_acl_list:
del_cmd = XML_CMD_TAG % ("no %s" % (acl_cfg))
confstr = XML_FREEFORM_SNIPPET % (del_cmd)
LOG.info(_LI("Delete ACL: %(del_cmd)s") % {'del_cmd': del_cmd})
conn.edit_config(target='running', config=confstr)
return delete_acl_list
开发者ID:JoelCapitao,项目名称:networking-cisco,代码行数:53,代码来源:asr1k_cfg_syncer.py
示例12: subintf_hsrp_ip_check
def subintf_hsrp_ip_check(self, intf_list, is_external, ip_addr):
for target_intf in intf_list:
ha_intf = target_intf['ha_info']['ha_port']
target_ip = ha_intf['fixed_ips'][0]['ip_address']
LOG.info(_LI("target_ip: %(target_ip)s, actual_ip: %(ip_addr)s") %
{'target_ip': target_ip,
'ip_addr': ip_addr})
if ip_addr != target_ip:
LOG.info(_LI("HSRP VIP mismatch, deleting"))
return False
return True
return False
开发者ID:JoelCapitao,项目名称:networking-cisco,代码行数:14,代码来源:asr1k_cfg_syncer.py
示例13: _create_svc_vm_hosting_devices
def _create_svc_vm_hosting_devices(self, context, num, template):
"""Creates <num> or less service VM instances based on <template>.
These hosting devices can be bound to a certain tenant or for shared
use. A list with the created hosting device VMs is returned.
"""
hosting_devices = []
template_id = template['id']
credentials_id = template['default_credentials_id']
plugging_drv = self.get_hosting_device_plugging_driver(context,
template_id)
hosting_device_drv = self.get_hosting_device_driver(context,
template_id)
if plugging_drv is None or hosting_device_drv is None or num <= 0:
return hosting_devices
#TODO(bobmel): Determine value for max_hosted properly
max_hosted = 1 # template['slot_capacity']
dev_data, mgmt_context = self._get_resources_properties_for_hd(
template, credentials_id)
credentials_info = self._credentials.get(credentials_id)
if credentials_info is None:
LOG.error(_LE('Could not find credentials for hosting device'
'template %s. Aborting VM hosting device creation.'),
template_id)
return hosting_devices
connectivity_info = self._get_mgmt_connectivity_info(
context, self.mgmt_subnet_id())
for i in range(num):
complementary_id = uuidutils.generate_uuid()
res = plugging_drv.create_hosting_device_resources(
context, complementary_id, self.l3_tenant_id(), mgmt_context,
max_hosted)
if res.get('mgmt_port') is None:
# Required ports could not be created
return hosting_devices
connectivity_info['mgmt_port'] = res['mgmt_port']
vm_instance = self.svc_vm_mgr.dispatch_service_vm(
context, template['name'] + '_nrouter', template['image'],
template['flavor'], hosting_device_drv, credentials_info,
connectivity_info, res.get('ports'))
if vm_instance is not None:
dev_data.update(
{'id': vm_instance['id'],
'complementary_id': complementary_id,
'management_ip_address': res['mgmt_port'][
'fixed_ips'][0]['ip_address'],
'management_port_id': res['mgmt_port']['id']})
self.create_hosting_device(context,
{'hosting_device': dev_data})
hosting_devices.append(vm_instance)
else:
# Fundamental error like could not contact Nova
# Cleanup anything we created
plugging_drv.delete_hosting_device_resources(
context, self.l3_tenant_id(), **res)
break
LOG.info(_LI('Created %(num)d hosting device VMs based on template '
'%(t_id)s'), {'num': len(hosting_devices),
't_id': template_id})
return hosting_devices
开发者ID:JoelCapitao,项目名称:networking-cisco,代码行数:60,代码来源:hosting_device_manager_db.py
示例14: mgmt_nw_id
def mgmt_nw_id(cls):
"""Returns id of the management network."""
if cls._mgmt_nw_uuid is None:
tenant_id = cls.l3_tenant_id()
if not tenant_id:
return
net = manager.NeutronManager.get_plugin().get_networks(
neutron_context.get_admin_context(),
{'tenant_id': [tenant_id],
'name': [cfg.CONF.general.management_network]},
['id', 'subnets'])
if len(net) == 1:
num_subnets = len(net[0]['subnets'])
if num_subnets == 0:
LOG.error(_LE('The management network has no subnet. '
'Please assign one.'))
return
elif num_subnets > 1:
LOG.info(_LI('The management network has %d subnets. The '
'first one will be used.'), num_subnets)
cls._mgmt_nw_uuid = net[0].get('id')
cls._mgmt_subnet_uuid = net[0]['subnets'][0]
elif len(net) > 1:
# Management network must have a unique name.
LOG.error(_LE('The management network for does not have '
'unique name. Please ensure that it is.'))
else:
# Management network has not been created.
LOG.error(_LE('There is no virtual management network. Please '
'create one.'))
return cls._mgmt_nw_uuid
开发者ID:JoelCapitao,项目名称:networking-cisco,代码行数:31,代码来源:hosting_device_manager_db.py
示例15: send_vdp_port_event
def send_vdp_port_event(self, port_uuid, mac, net_uuid,
segmentation_id, status, oui):
'''Send vNIC UP/Down event to VDP
:param port_uuid: a ovslib.VifPort object.
:mac: MAC address of the VNIC
:param net_uuid: the net_uuid this port is to be associated with.
:param segmentation_id: the VID for 'vlan' or tunnel ID for 'tunnel'
:param status: Type of port event. 'up' or 'down'
:oui: OUI Parameters
'''
lldpad_port = self.lldpad_info
if not lldpad_port:
LOG.error(_LE("There is no LLDPad port available."))
return False
ret = False
if status == 'up':
if self.vdp_mode == constants.VDP_SEGMENT_MODE:
port_name = self.ext_br_obj.get_ofport_name(port_uuid)
if port_name is None:
LOG.error(_LE("Unknown portname for uuid %s"), port_uuid)
return False
LOG.info(_LI('portname for uuid %s is '), port_name)
ret = self.port_up_segment_mode(lldpad_port, port_name,
port_uuid, mac, net_uuid,
segmentation_id, oui)
else:
if self.vdp_mode == constants.VDP_SEGMENT_MODE:
ret = self.port_down_segment_mode(lldpad_port, port_uuid,
mac, net_uuid,
segmentation_id, oui)
return ret
开发者ID:abattye,项目名称:networking-cisco,代码行数:33,代码来源:ovs_vdp.py
示例16: _fw_policy_create
def _fw_policy_create(self, drvr_name, data, cache):
"""Firewall Policy create routine.
This function updates its local cache with policy parameters.
It checks if local cache has information about the rules
associated with the policy. If not, it means a restart has
happened. It retrieves the rules associated with the policy by
calling Openstack API's and calls the rule create internal routine.
"""
policy = {}
fw_policy = data.get('firewall_policy')
tenant_id = fw_policy.get('tenant_id')
LOG.info(_LI("Creating policy for tenant %s"), tenant_id)
policy_id = fw_policy.get('id')
policy_name = fw_policy.get('name')
pol_rule_dict = fw_policy.get('firewall_rules')
if tenant_id not in self.fwid_attr:
self.fwid_attr[tenant_id] = FwMapAttr(tenant_id)
policy['name'] = policy_name
policy['rule_dict'] = pol_rule_dict
self.fwid_attr[tenant_id].store_policy(policy_id, policy)
if not cache:
self._check_create_fw(tenant_id, drvr_name)
self.tenant_db.store_policy_tenant(policy_id, tenant_id)
for rule in pol_rule_dict:
rule_id = rule
if not self.fwid_attr[tenant_id].is_rule_present(rule_id):
rule_data = self.os_helper.get_fw_rule(rule_id)
if rule_data is not None:
self.fw_rule_create(rule_data, cache=cache)
开发者ID:noironetworks,项目名称:networking-cisco,代码行数:30,代码来源:fw_mgr.py
示例17: _enable_itfcs
def _enable_itfcs(self, conn):
"""Enable the interfaces of a CSR1kv Virtual Router.
When the virtual router first boots up, all interfaces except
management are down. This method will enable all data interfaces.
Note: In CSR1kv, GigabitEthernet 0 is not present. GigabitEthernet 1
is used as management and GigabitEthernet 2 and up are used for data.
This might change in future releases.
Currently only the second and third Gig interfaces corresponding to a
single (T1,T2) pair and configured as trunk for VLAN and VXLAN
is enabled.
:param conn: Connection object
:return: True or False
"""
# ToDo(Hareesh): Interfaces are hard coded for now. Make it dynamic.
interfaces = ["GigabitEthernet 2", "GigabitEthernet 3"]
try:
for i in interfaces:
conf_str = snippets.ENABLE_INTF % i
rpc_obj = conn.edit_config(target="running", config=conf_str)
if self._check_response(rpc_obj, "ENABLE_INTF"):
LOG.info(_LI("Enabled interface %s "), i)
time.sleep(1)
except Exception:
return False
return True
开发者ID:noironetworks,项目名称:networking-cisco,代码行数:30,代码来源:iosxe_routing_driver.py
示例18: _create_token
def _create_token(self):
"""Create new token for using novaclient API."""
ks = keyc.Client(username=self._user_name,
password=self._admin_password,
tenant_name=self._tenant_name,
auth_url=self._url)
result = ks.authenticate()
if result:
access = ks.auth_ref
token = access.get('token')
self._token_id = token['id']
self._project_id = token['tenant'].get('id')
service_catalog = access.get('serviceCatalog')
for sc in service_catalog:
if sc['type'] == "compute" and sc['name'] == 'nova':
endpoints = sc['endpoints']
for endp in endpoints:
self._auth_url = endp['adminURL']
LOG.info(_LI('_create_token: token = %s'), token)
# Create nova clinet.
self._novaclnt = self._create_nova_client()
return token
else:
# Failed request.
LOG.error(_LE('Failed to send token create request.'))
return
开发者ID:bdemers,项目名称:networking-cisco,代码行数:29,代码来源:dfa_instance_api.py
示例19: process_vm_event
def process_vm_event(self, msg, phy_uplink):
LOG.info(
_LI("In processing VM Event status %(status)s for MAC " "%(mac)s UUID %(uuid)s oui %(oui)s"),
{"status": msg.get_status(), "mac": msg.get_mac(), "uuid": msg.get_port_uuid(), "oui": msg.get_oui()},
)
time.sleep(10)
if msg.get_status() == "up":
res_fail = constants.CREATE_FAIL
else:
res_fail = constants.DELETE_FAIL
if not self.uplink_det_compl or phy_uplink not in self.ovs_vdp_obj_dict:
LOG.error(_LE("Uplink Port Event not received yet"))
self.update_vm_result(msg.get_port_uuid(), res_fail)
return
ovs_vdp_obj = self.ovs_vdp_obj_dict[phy_uplink]
ret = ovs_vdp_obj.send_vdp_port_event(
msg.get_port_uuid(),
msg.get_mac(),
msg.get_net_uuid(),
msg.get_segmentation_id(),
msg.get_status(),
msg.get_oui(),
)
if not ret:
LOG.error(_LE("Error in VDP port event, Err Queue enq"))
self.update_vm_result(msg.get_port_uuid(), res_fail)
else:
self.update_vm_result(msg.get_port_uuid(), constants.RESULT_SUCCESS)
开发者ID:noironetworks,项目名称:networking-cisco,代码行数:28,代码来源:dfa_vdp_mgr.py
示例20: _send_request
def _send_request(self, operation, url, payload, desc):
"""Send request to DCNM."""
res = None
try:
payload_json = None
if payload and payload != '':
payload_json = jsonutils.dumps(payload)
self._login()
desc_lookup = {'POST': ' creation', 'PUT': ' update',
'DELETE': ' deletion', 'GET': ' get'}
res = requests.request(operation, url, data=payload_json,
headers=self._req_headers,
timeout=self.timeout_resp)
desc += desc_lookup.get(operation, operation.lower())
LOG.info(_LI("DCNM-send_request: %(desc)s %(url)s %(pld)s"),
{'desc': desc, 'url': url, 'pld': payload})
self._logout()
except (requests.HTTPError, requests.Timeout,
requests.ConnectionError) as exc:
LOG.exception(_LE('Error during request: %s'), exc)
raise dexc.DfaClientRequestFailed(reason=exc)
return res
开发者ID:noironetworks,项目名称:networking-cisco,代码行数:26,代码来源:cisco_dfa_rest.py
注:本文中的networking_cisco._i18n._LI函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论