repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py | ASR1kRoutingDriver._get_item | def _get_item(list_containing_dicts_entries, attribute_value,
attribute_name='subnet_id'):
"""Searches a list of dicts and returns the first matching entry
The dict entry returned contains the attribute 'attribute_name' whose
value equals 'attribute_value'. If no such dict is ... | python | def _get_item(list_containing_dicts_entries, attribute_value,
attribute_name='subnet_id'):
"""Searches a list of dicts and returns the first matching entry
The dict entry returned contains the attribute 'attribute_name' whose
value equals 'attribute_value'. If no such dict is ... | [
"def",
"_get_item",
"(",
"list_containing_dicts_entries",
",",
"attribute_value",
",",
"attribute_name",
"=",
"'subnet_id'",
")",
":",
"for",
"item",
"in",
"list_containing_dicts_entries",
":",
"if",
"item",
".",
"get",
"(",
"attribute_name",
")",
"==",
"attribute_v... | Searches a list of dicts and returns the first matching entry
The dict entry returned contains the attribute 'attribute_name' whose
value equals 'attribute_value'. If no such dict is found in the list
an empty dict is returned. | [
"Searches",
"a",
"list",
"of",
"dicts",
"and",
"returns",
"the",
"first",
"matching",
"entry"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py#L425-L436 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py | ASR1kRoutingDriver._nat_rules_for_internet_access | def _nat_rules_for_internet_access(self, acl_no, network, netmask,
inner_itfc, outer_itfc, vrf_name):
"""Configure the NAT rules for an internal network.
Configuring NAT rules in the ASR1k is a three step process. First
create an ACL for the IP range of th... | python | def _nat_rules_for_internet_access(self, acl_no, network, netmask,
inner_itfc, outer_itfc, vrf_name):
"""Configure the NAT rules for an internal network.
Configuring NAT rules in the ASR1k is a three step process. First
create an ACL for the IP range of th... | [
"def",
"_nat_rules_for_internet_access",
"(",
"self",
",",
"acl_no",
",",
"network",
",",
"netmask",
",",
"inner_itfc",
",",
"outer_itfc",
",",
"vrf_name",
")",
":",
"acl_present",
"=",
"self",
".",
"_check_acl",
"(",
"acl_no",
",",
"network",
",",
"netmask",
... | Configure the NAT rules for an internal network.
Configuring NAT rules in the ASR1k is a three step process. First
create an ACL for the IP range of the internal network. Then enable
dynamic source NATing on the external interface of the ASR1k for this
ACL and VRF of the neutron router.... | [
"Configure",
"the",
"NAT",
"rules",
"for",
"an",
"internal",
"network",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py#L851-L892 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py | ASR1kRoutingDriver._remove_internal_nw_nat_rules | def _remove_internal_nw_nat_rules(self, ri, ports, ext_port,
intf_deleted=False):
"""
Removes the NAT rules already configured when an internal network is
removed.
:param ri -- router-info object
:param ports -- list of affect... | python | def _remove_internal_nw_nat_rules(self, ri, ports, ext_port,
intf_deleted=False):
"""
Removes the NAT rules already configured when an internal network is
removed.
:param ri -- router-info object
:param ports -- list of affect... | [
"def",
"_remove_internal_nw_nat_rules",
"(",
"self",
",",
"ri",
",",
"ports",
",",
"ext_port",
",",
"intf_deleted",
"=",
"False",
")",
":",
"acls",
"=",
"[",
"]",
"# first disable nat in all inner ports",
"for",
"port",
"in",
"ports",
":",
"in_itfc_name",
"=",
... | Removes the NAT rules already configured when an internal network is
removed.
:param ri -- router-info object
:param ports -- list of affected ports where network nat rules
was affected
:param ext_port -- external facing port
:para... | [
"Removes",
"the",
"NAT",
"rules",
"already",
"configured",
"when",
"an",
"internal",
"network",
"is",
"removed",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py#L894-L932 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py | ASR1kRoutingDriver._do_add_floating_ip_asr1k | def _do_add_floating_ip_asr1k(self, floating_ip, fixed_ip, vrf,
ex_gw_port):
"""
To implement a floating ip, an ip static nat is configured in the
underlying router ex_gw_port contains data to derive the vlan
associated with related subnet for the fixed ... | python | def _do_add_floating_ip_asr1k(self, floating_ip, fixed_ip, vrf,
ex_gw_port):
"""
To implement a floating ip, an ip static nat is configured in the
underlying router ex_gw_port contains data to derive the vlan
associated with related subnet for the fixed ... | [
"def",
"_do_add_floating_ip_asr1k",
"(",
"self",
",",
"floating_ip",
",",
"fixed_ip",
",",
"vrf",
",",
"ex_gw_port",
")",
":",
"vlan",
"=",
"ex_gw_port",
"[",
"'hosting_info'",
"]",
"[",
"'segmentation_id'",
"]",
"hsrp_grp",
"=",
"ex_gw_port",
"[",
"ha",
".",
... | To implement a floating ip, an ip static nat is configured in the
underlying router ex_gw_port contains data to derive the vlan
associated with related subnet for the fixed ip. The vlan in turn
is applied to the redundancy parameter for setting the IP NAT. | [
"To",
"implement",
"a",
"floating",
"ip",
"an",
"ip",
"static",
"nat",
"is",
"configured",
"in",
"the",
"underlying",
"router",
"ex_gw_port",
"contains",
"data",
"to",
"derive",
"the",
"vlan",
"associated",
"with",
"related",
"subnet",
"for",
"the",
"fixed",
... | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py#L952-L970 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/rpc/devices_cfgagent_rpc_cb.py | DeviceMgrCfgRpcCallback.report_non_responding_hosting_devices | def report_non_responding_hosting_devices(self, context, host,
hosting_device_ids):
"""Report that a hosting device is determined to be dead.
:param context: contains user information
:param host: originator of callback
:param hosting_device... | python | def report_non_responding_hosting_devices(self, context, host,
hosting_device_ids):
"""Report that a hosting device is determined to be dead.
:param context: contains user information
:param host: originator of callback
:param hosting_device... | [
"def",
"report_non_responding_hosting_devices",
"(",
"self",
",",
"context",
",",
"host",
",",
"hosting_device_ids",
")",
":",
"# let the generic status update callback function handle this callback",
"self",
".",
"update_hosting_device_status",
"(",
"context",
",",
"host",
"... | Report that a hosting device is determined to be dead.
:param context: contains user information
:param host: originator of callback
:param hosting_device_ids: list of non-responding hosting devices | [
"Report",
"that",
"a",
"hosting",
"device",
"is",
"determined",
"to",
"be",
"dead",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/rpc/devices_cfgagent_rpc_cb.py#L29-L39 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/rpc/devices_cfgagent_rpc_cb.py | DeviceMgrCfgRpcCallback.update_hosting_device_status | def update_hosting_device_status(self, context, host, status_info):
"""Report status changes for hosting devices.
:param context: contains user information
:param host: originator of callback
:param status_info: Dictionary with list of hosting device ids for
each type of hos... | python | def update_hosting_device_status(self, context, host, status_info):
"""Report status changes for hosting devices.
:param context: contains user information
:param host: originator of callback
:param status_info: Dictionary with list of hosting device ids for
each type of hos... | [
"def",
"update_hosting_device_status",
"(",
"self",
",",
"context",
",",
"host",
",",
"status_info",
")",
":",
"for",
"status",
",",
"hd_ids",
"in",
"six",
".",
"iteritems",
"(",
"status_info",
")",
":",
"# update hosting device entry in db to new status",
"hd_spec"... | Report status changes for hosting devices.
:param context: contains user information
:param host: originator of callback
:param status_info: Dictionary with list of hosting device ids for
each type of hosting device status to be updated i.e.::
{
... | [
"Report",
"status",
"changes",
"for",
"hosting",
"devices",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/rpc/devices_cfgagent_rpc_cb.py#L58-L80 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/rpc/devices_cfgagent_rpc_cb.py | DeviceMgrCfgRpcCallback.get_hosting_devices_for_agent | def get_hosting_devices_for_agent(self, context, host):
"""Fetches routers that a Cisco cfg agent is managing.
This function is supposed to be called when the agent has started,
is ready to take on assignments and before any callbacks to fetch
logical resources are issued.
:par... | python | def get_hosting_devices_for_agent(self, context, host):
"""Fetches routers that a Cisco cfg agent is managing.
This function is supposed to be called when the agent has started,
is ready to take on assignments and before any callbacks to fetch
logical resources are issued.
:par... | [
"def",
"get_hosting_devices_for_agent",
"(",
"self",
",",
"context",
",",
"host",
")",
":",
"agent_ids",
"=",
"self",
".",
"_dmplugin",
".",
"get_cfg_agents",
"(",
"context",
",",
"active",
"=",
"None",
",",
"filters",
"=",
"{",
"'host'",
":",
"[",
"host",... | Fetches routers that a Cisco cfg agent is managing.
This function is supposed to be called when the agent has started,
is ready to take on assignments and before any callbacks to fetch
logical resources are issued.
:param context: contains user information
:param host: originat... | [
"Fetches",
"routers",
"that",
"a",
"Cisco",
"cfg",
"agent",
"is",
"managing",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/rpc/devices_cfgagent_rpc_cb.py#L87-L104 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/scheduler/l3_routertype_aware_schedulers_db.py | L3RouterTypeAwareSchedulerDbMixin.add_router_to_hosting_device | def add_router_to_hosting_device(self, context, hosting_device_id,
router_id):
"""Add a (non-hosted) router to a hosting device."""
e_context = context.elevated()
r_hd_binding_db = self._get_router_binding_info(e_context, router_id)
if r_hd_binding_db... | python | def add_router_to_hosting_device(self, context, hosting_device_id,
router_id):
"""Add a (non-hosted) router to a hosting device."""
e_context = context.elevated()
r_hd_binding_db = self._get_router_binding_info(e_context, router_id)
if r_hd_binding_db... | [
"def",
"add_router_to_hosting_device",
"(",
"self",
",",
"context",
",",
"hosting_device_id",
",",
"router_id",
")",
":",
"e_context",
"=",
"context",
".",
"elevated",
"(",
")",
"r_hd_binding_db",
"=",
"self",
".",
"_get_router_binding_info",
"(",
"e_context",
","... | Add a (non-hosted) router to a hosting device. | [
"Add",
"a",
"(",
"non",
"-",
"hosted",
")",
"router",
"to",
"a",
"hosting",
"device",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/scheduler/l3_routertype_aware_schedulers_db.py#L87-L113 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/scheduler/l3_routertype_aware_schedulers_db.py | L3RouterTypeAwareSchedulerDbMixin.remove_router_from_hosting_device | def remove_router_from_hosting_device(self, context, hosting_device_id,
router_id):
"""Remove the router from hosting device.
After removal, the router will be non-hosted until there is update
which leads to re-schedule or be added to another hosting de... | python | def remove_router_from_hosting_device(self, context, hosting_device_id,
router_id):
"""Remove the router from hosting device.
After removal, the router will be non-hosted until there is update
which leads to re-schedule or be added to another hosting de... | [
"def",
"remove_router_from_hosting_device",
"(",
"self",
",",
"context",
",",
"hosting_device_id",
",",
"router_id",
")",
":",
"e_context",
"=",
"context",
".",
"elevated",
"(",
")",
"r_hd_binding_db",
"=",
"self",
".",
"_get_router_binding_info",
"(",
"e_context",
... | Remove the router from hosting device.
After removal, the router will be non-hosted until there is update
which leads to re-schedule or be added to another hosting device
manually. | [
"Remove",
"the",
"router",
"from",
"hosting",
"device",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/scheduler/l3_routertype_aware_schedulers_db.py#L115-L142 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/scheduler/l3_routertype_aware_schedulers_db.py | L3RouterTypeAwareSchedulerDbMixin.get_number_of_agents_for_scheduling | def get_number_of_agents_for_scheduling(self, context):
"""Return number of agents on which the router will be scheduled."""
num_agents = len(self.get_l3_agents(context, active=True,
filters={'agent_modes': [bc.constants.L3_AGENT_MODE_LEGACY,
bc.constant... | python | def get_number_of_agents_for_scheduling(self, context):
"""Return number of agents on which the router will be scheduled."""
num_agents = len(self.get_l3_agents(context, active=True,
filters={'agent_modes': [bc.constants.L3_AGENT_MODE_LEGACY,
bc.constant... | [
"def",
"get_number_of_agents_for_scheduling",
"(",
"self",
",",
"context",
")",
":",
"num_agents",
"=",
"len",
"(",
"self",
".",
"get_l3_agents",
"(",
"context",
",",
"active",
"=",
"True",
",",
"filters",
"=",
"{",
"'agent_modes'",
":",
"[",
"bc",
".",
"c... | Return number of agents on which the router will be scheduled. | [
"Return",
"number",
"of",
"agents",
"on",
"which",
"the",
"router",
"will",
"be",
"scheduled",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/scheduler/l3_routertype_aware_schedulers_db.py#L276-L291 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/l3/l3_router_appliance_db.py | _notify_subnet_create | def _notify_subnet_create(resource, event, trigger, **kwargs):
"""Called when a new subnet is created in the external network"""
context = kwargs['context']
subnet = kwargs['subnet']
l3plugin = bc.get_plugin(L3_ROUTER_NAT)
for router in l3plugin.get_routers(context):
if (router['external_gat... | python | def _notify_subnet_create(resource, event, trigger, **kwargs):
"""Called when a new subnet is created in the external network"""
context = kwargs['context']
subnet = kwargs['subnet']
l3plugin = bc.get_plugin(L3_ROUTER_NAT)
for router in l3plugin.get_routers(context):
if (router['external_gat... | [
"def",
"_notify_subnet_create",
"(",
"resource",
",",
"event",
",",
"trigger",
",",
"*",
"*",
"kwargs",
")",
":",
"context",
"=",
"kwargs",
"[",
"'context'",
"]",
"subnet",
"=",
"kwargs",
"[",
"'subnet'",
"]",
"l3plugin",
"=",
"bc",
".",
"get_plugin",
"(... | Called when a new subnet is created in the external network | [
"Called",
"when",
"a",
"new",
"subnet",
"is",
"created",
"in",
"the",
"external",
"network"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/l3/l3_router_appliance_db.py#L1601-L1611 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/l3/l3_router_appliance_db.py | _notify_cfg_agent_port_update | def _notify_cfg_agent_port_update(resource, event, trigger, **kwargs):
"""Called when router port/interface is enabled/disabled"""
original_port = kwargs.get('original_port')
updated_port = kwargs.get('port')
if (updated_port is not None and original_port is not None and (
updated_port.get('admin... | python | def _notify_cfg_agent_port_update(resource, event, trigger, **kwargs):
"""Called when router port/interface is enabled/disabled"""
original_port = kwargs.get('original_port')
updated_port = kwargs.get('port')
if (updated_port is not None and original_port is not None and (
updated_port.get('admin... | [
"def",
"_notify_cfg_agent_port_update",
"(",
"resource",
",",
"event",
",",
"trigger",
",",
"*",
"*",
"kwargs",
")",
":",
"original_port",
"=",
"kwargs",
".",
"get",
"(",
"'original_port'",
")",
"updated_port",
"=",
"kwargs",
".",
"get",
"(",
"'port'",
")",
... | Called when router port/interface is enabled/disabled | [
"Called",
"when",
"router",
"port",
"/",
"interface",
"is",
"enabled",
"/",
"disabled"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/l3/l3_router_appliance_db.py#L1614-L1633 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.is_port_profile_created | def is_port_profile_created(self, vlan_id, device_id):
"""Indicates if port profile has been created on UCS Manager."""
entry = self.session.query(ucsm_model.PortProfile).filter_by(
vlan_id=vlan_id, device_id=device_id).first()
return entry and entry.created_on_ucs | python | def is_port_profile_created(self, vlan_id, device_id):
"""Indicates if port profile has been created on UCS Manager."""
entry = self.session.query(ucsm_model.PortProfile).filter_by(
vlan_id=vlan_id, device_id=device_id).first()
return entry and entry.created_on_ucs | [
"def",
"is_port_profile_created",
"(",
"self",
",",
"vlan_id",
",",
"device_id",
")",
":",
"entry",
"=",
"self",
".",
"session",
".",
"query",
"(",
"ucsm_model",
".",
"PortProfile",
")",
".",
"filter_by",
"(",
"vlan_id",
"=",
"vlan_id",
",",
"device_id",
"... | Indicates if port profile has been created on UCS Manager. | [
"Indicates",
"if",
"port",
"profile",
"has",
"been",
"created",
"on",
"UCS",
"Manager",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L26-L30 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.get_port_profile_for_vlan | def get_port_profile_for_vlan(self, vlan_id, device_id):
"""Returns Vlan id associated with the port profile."""
entry = self.session.query(ucsm_model.PortProfile).filter_by(
vlan_id=vlan_id, device_id=device_id).first()
return entry.profile_id if entry else None | python | def get_port_profile_for_vlan(self, vlan_id, device_id):
"""Returns Vlan id associated with the port profile."""
entry = self.session.query(ucsm_model.PortProfile).filter_by(
vlan_id=vlan_id, device_id=device_id).first()
return entry.profile_id if entry else None | [
"def",
"get_port_profile_for_vlan",
"(",
"self",
",",
"vlan_id",
",",
"device_id",
")",
":",
"entry",
"=",
"self",
".",
"session",
".",
"query",
"(",
"ucsm_model",
".",
"PortProfile",
")",
".",
"filter_by",
"(",
"vlan_id",
"=",
"vlan_id",
",",
"device_id",
... | Returns Vlan id associated with the port profile. | [
"Returns",
"Vlan",
"id",
"associated",
"with",
"the",
"port",
"profile",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L32-L36 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.add_port_profile | def add_port_profile(self, profile_name, vlan_id, device_id):
"""Adds a port profile and its vlan_id to the table."""
if not self.get_port_profile_for_vlan(vlan_id, device_id):
port_profile = ucsm_model.PortProfile(profile_id=profile_name,
vl... | python | def add_port_profile(self, profile_name, vlan_id, device_id):
"""Adds a port profile and its vlan_id to the table."""
if not self.get_port_profile_for_vlan(vlan_id, device_id):
port_profile = ucsm_model.PortProfile(profile_id=profile_name,
vl... | [
"def",
"add_port_profile",
"(",
"self",
",",
"profile_name",
",",
"vlan_id",
",",
"device_id",
")",
":",
"if",
"not",
"self",
".",
"get_port_profile_for_vlan",
"(",
"vlan_id",
",",
"device_id",
")",
":",
"port_profile",
"=",
"ucsm_model",
".",
"PortProfile",
"... | Adds a port profile and its vlan_id to the table. | [
"Adds",
"a",
"port",
"profile",
"and",
"its",
"vlan_id",
"to",
"the",
"table",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L38-L47 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.set_port_profile_created | def set_port_profile_created(self, vlan_id, profile_name, device_id):
"""Sets created_on_ucs flag to True."""
with self.session.begin(subtransactions=True):
port_profile = self.session.query(
ucsm_model.PortProfile).filter_by(
vlan_id=vlan_id, profile_id=p... | python | def set_port_profile_created(self, vlan_id, profile_name, device_id):
"""Sets created_on_ucs flag to True."""
with self.session.begin(subtransactions=True):
port_profile = self.session.query(
ucsm_model.PortProfile).filter_by(
vlan_id=vlan_id, profile_id=p... | [
"def",
"set_port_profile_created",
"(",
"self",
",",
"vlan_id",
",",
"profile_name",
",",
"device_id",
")",
":",
"with",
"self",
".",
"session",
".",
"begin",
"(",
"subtransactions",
"=",
"True",
")",
":",
"port_profile",
"=",
"self",
".",
"session",
".",
... | Sets created_on_ucs flag to True. | [
"Sets",
"created_on_ucs",
"flag",
"to",
"True",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L49-L64 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.delete_vlan_entry | def delete_vlan_entry(self, vlan_id):
"""Deletes entry for a vlan_id if it exists."""
with self.session.begin(subtransactions=True):
try:
self.session.query(ucsm_model.PortProfile).filter_by(
vlan_id=vlan_id).delete()
except orm.exc.NoResultFou... | python | def delete_vlan_entry(self, vlan_id):
"""Deletes entry for a vlan_id if it exists."""
with self.session.begin(subtransactions=True):
try:
self.session.query(ucsm_model.PortProfile).filter_by(
vlan_id=vlan_id).delete()
except orm.exc.NoResultFou... | [
"def",
"delete_vlan_entry",
"(",
"self",
",",
"vlan_id",
")",
":",
"with",
"self",
".",
"session",
".",
"begin",
"(",
"subtransactions",
"=",
"True",
")",
":",
"try",
":",
"self",
".",
"session",
".",
"query",
"(",
"ucsm_model",
".",
"PortProfile",
")",
... | Deletes entry for a vlan_id if it exists. | [
"Deletes",
"entry",
"for",
"a",
"vlan_id",
"if",
"it",
"exists",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L66-L73 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.add_service_profile_template | def add_service_profile_template(self, vlan_id, sp_template, ucsm_ip):
"""Adds an entry for a vlan_id on a SP template to the table."""
if not self.get_sp_template_vlan_entry(vlan_id, sp_template, ucsm_ip):
entry = ucsm_model.ServiceProfileTemplate(vlan_id=vlan_id,
... | python | def add_service_profile_template(self, vlan_id, sp_template, ucsm_ip):
"""Adds an entry for a vlan_id on a SP template to the table."""
if not self.get_sp_template_vlan_entry(vlan_id, sp_template, ucsm_ip):
entry = ucsm_model.ServiceProfileTemplate(vlan_id=vlan_id,
... | [
"def",
"add_service_profile_template",
"(",
"self",
",",
"vlan_id",
",",
"sp_template",
",",
"ucsm_ip",
")",
":",
"if",
"not",
"self",
".",
"get_sp_template_vlan_entry",
"(",
"vlan_id",
",",
"sp_template",
",",
"ucsm_ip",
")",
":",
"entry",
"=",
"ucsm_model",
... | Adds an entry for a vlan_id on a SP template to the table. | [
"Adds",
"an",
"entry",
"for",
"a",
"vlan_id",
"on",
"a",
"SP",
"template",
"to",
"the",
"table",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L82-L89 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.set_sp_template_updated | def set_sp_template_updated(self, vlan_id, sp_template, device_id):
"""Sets update_on_ucs flag to True."""
entry = self.get_sp_template_vlan_entry(vlan_id,
sp_template,
device_id)
if entry:
... | python | def set_sp_template_updated(self, vlan_id, sp_template, device_id):
"""Sets update_on_ucs flag to True."""
entry = self.get_sp_template_vlan_entry(vlan_id,
sp_template,
device_id)
if entry:
... | [
"def",
"set_sp_template_updated",
"(",
"self",
",",
"vlan_id",
",",
"sp_template",
",",
"device_id",
")",
":",
"entry",
"=",
"self",
".",
"get_sp_template_vlan_entry",
"(",
"vlan_id",
",",
"sp_template",
",",
"device_id",
")",
"if",
"entry",
":",
"entry",
".",... | Sets update_on_ucs flag to True. | [
"Sets",
"update_on_ucs",
"flag",
"to",
"True",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L91-L101 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.delete_sp_template_for_vlan | def delete_sp_template_for_vlan(self, vlan_id):
"""Deletes SP Template for a vlan_id if it exists."""
with self.session.begin(subtransactions=True):
try:
self.session.query(
ucsm_model.ServiceProfileTemplate).filter_by(
vlan_id=vlan_id)... | python | def delete_sp_template_for_vlan(self, vlan_id):
"""Deletes SP Template for a vlan_id if it exists."""
with self.session.begin(subtransactions=True):
try:
self.session.query(
ucsm_model.ServiceProfileTemplate).filter_by(
vlan_id=vlan_id)... | [
"def",
"delete_sp_template_for_vlan",
"(",
"self",
",",
"vlan_id",
")",
":",
"with",
"self",
".",
"session",
".",
"begin",
"(",
"subtransactions",
"=",
"True",
")",
":",
"try",
":",
"self",
".",
"session",
".",
"query",
"(",
"ucsm_model",
".",
"ServiceProf... | Deletes SP Template for a vlan_id if it exists. | [
"Deletes",
"SP",
"Template",
"for",
"a",
"vlan_id",
"if",
"it",
"exists",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L103-L111 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.add_vnic_template | def add_vnic_template(self, vlan_id, ucsm_ip, vnic_template, physnet):
"""Adds an entry for a vlan_id on a SP template to the table."""
if not self.get_vnic_template_vlan_entry(vlan_id, vnic_template,
ucsm_ip, physnet):
vnic_t = ucsm_model.VnicTemplate(vlan_id=vlan_id,
... | python | def add_vnic_template(self, vlan_id, ucsm_ip, vnic_template, physnet):
"""Adds an entry for a vlan_id on a SP template to the table."""
if not self.get_vnic_template_vlan_entry(vlan_id, vnic_template,
ucsm_ip, physnet):
vnic_t = ucsm_model.VnicTemplate(vlan_id=vlan_id,
... | [
"def",
"add_vnic_template",
"(",
"self",
",",
"vlan_id",
",",
"ucsm_ip",
",",
"vnic_template",
",",
"physnet",
")",
":",
"if",
"not",
"self",
".",
"get_vnic_template_vlan_entry",
"(",
"vlan_id",
",",
"vnic_template",
",",
"ucsm_ip",
",",
"physnet",
")",
":",
... | Adds an entry for a vlan_id on a SP template to the table. | [
"Adds",
"an",
"entry",
"for",
"a",
"vlan_id",
"on",
"a",
"SP",
"template",
"to",
"the",
"table",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L122-L133 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.set_vnic_template_updated | def set_vnic_template_updated(self, vlan_id, ucsm_ip, vnic_template,
physnet):
"""Sets update_on_ucs flag to True for a Vnic Template entry."""
with self.session.begin(subtransactions=True):
entry = self.get_vnic_template_vlan_entry(vlan_id, vnic_template,
... | python | def set_vnic_template_updated(self, vlan_id, ucsm_ip, vnic_template,
physnet):
"""Sets update_on_ucs flag to True for a Vnic Template entry."""
with self.session.begin(subtransactions=True):
entry = self.get_vnic_template_vlan_entry(vlan_id, vnic_template,
... | [
"def",
"set_vnic_template_updated",
"(",
"self",
",",
"vlan_id",
",",
"ucsm_ip",
",",
"vnic_template",
",",
"physnet",
")",
":",
"with",
"self",
".",
"session",
".",
"begin",
"(",
"subtransactions",
"=",
"True",
")",
":",
"entry",
"=",
"self",
".",
"get_vn... | Sets update_on_ucs flag to True for a Vnic Template entry. | [
"Sets",
"update_on_ucs",
"flag",
"to",
"True",
"for",
"a",
"Vnic",
"Template",
"entry",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L135-L144 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.delete_vnic_template_for_vlan | def delete_vnic_template_for_vlan(self, vlan_id):
"""Deletes VNIC Template for a vlan_id and physnet if it exists."""
with self.session.begin(subtransactions=True):
try:
self.session.query(ucsm_model.VnicTemplate).filter_by(
vlan_id=vlan_id).delete()
... | python | def delete_vnic_template_for_vlan(self, vlan_id):
"""Deletes VNIC Template for a vlan_id and physnet if it exists."""
with self.session.begin(subtransactions=True):
try:
self.session.query(ucsm_model.VnicTemplate).filter_by(
vlan_id=vlan_id).delete()
... | [
"def",
"delete_vnic_template_for_vlan",
"(",
"self",
",",
"vlan_id",
")",
":",
"with",
"self",
".",
"session",
".",
"begin",
"(",
"subtransactions",
"=",
"True",
")",
":",
"try",
":",
"self",
".",
"session",
".",
"query",
"(",
"ucsm_model",
".",
"VnicTempl... | Deletes VNIC Template for a vlan_id and physnet if it exists. | [
"Deletes",
"VNIC",
"Template",
"for",
"a",
"vlan_id",
"and",
"physnet",
"if",
"it",
"exists",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L146-L153 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.has_port_profile_to_delete | def has_port_profile_to_delete(self, profile_name, device_id):
"""Returns True if port profile delete table containes PP."""
count = self.session.query(ucsm_model.PortProfileDelete).filter_by(
profile_id=profile_name, device_id=device_id).count()
return count != 0 | python | def has_port_profile_to_delete(self, profile_name, device_id):
"""Returns True if port profile delete table containes PP."""
count = self.session.query(ucsm_model.PortProfileDelete).filter_by(
profile_id=profile_name, device_id=device_id).count()
return count != 0 | [
"def",
"has_port_profile_to_delete",
"(",
"self",
",",
"profile_name",
",",
"device_id",
")",
":",
"count",
"=",
"self",
".",
"session",
".",
"query",
"(",
"ucsm_model",
".",
"PortProfileDelete",
")",
".",
"filter_by",
"(",
"profile_id",
"=",
"profile_name",
"... | Returns True if port profile delete table containes PP. | [
"Returns",
"True",
"if",
"port",
"profile",
"delete",
"table",
"containes",
"PP",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L155-L159 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.add_port_profile_to_delete_table | def add_port_profile_to_delete_table(self, profile_name, device_id):
"""Adds a port profile to the delete table."""
if not self.has_port_profile_to_delete(profile_name, device_id):
port_profile = ucsm_model.PortProfileDelete(
profile_id=profile_name, device_id=device_id)
... | python | def add_port_profile_to_delete_table(self, profile_name, device_id):
"""Adds a port profile to the delete table."""
if not self.has_port_profile_to_delete(profile_name, device_id):
port_profile = ucsm_model.PortProfileDelete(
profile_id=profile_name, device_id=device_id)
... | [
"def",
"add_port_profile_to_delete_table",
"(",
"self",
",",
"profile_name",
",",
"device_id",
")",
":",
"if",
"not",
"self",
".",
"has_port_profile_to_delete",
"(",
"profile_name",
",",
"device_id",
")",
":",
"port_profile",
"=",
"ucsm_model",
".",
"PortProfileDele... | Adds a port profile to the delete table. | [
"Adds",
"a",
"port",
"profile",
"to",
"the",
"delete",
"table",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L161-L168 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_db.py | UcsmDbModel.remove_port_profile_to_delete | def remove_port_profile_to_delete(self, profile_name, device_id):
"""Removes port profile to be deleted from table."""
with self.session.begin(subtransactions=True):
self.session.query(ucsm_model.PortProfileDelete).filter_by(
profile_id=profile_name, device_id=device_id).dele... | python | def remove_port_profile_to_delete(self, profile_name, device_id):
"""Removes port profile to be deleted from table."""
with self.session.begin(subtransactions=True):
self.session.query(ucsm_model.PortProfileDelete).filter_by(
profile_id=profile_name, device_id=device_id).dele... | [
"def",
"remove_port_profile_to_delete",
"(",
"self",
",",
"profile_name",
",",
"device_id",
")",
":",
"with",
"self",
".",
"session",
".",
"begin",
"(",
"subtransactions",
"=",
"True",
")",
":",
"self",
".",
"session",
".",
"query",
"(",
"ucsm_model",
".",
... | Removes port profile to be deleted from table. | [
"Removes",
"port",
"profile",
"to",
"be",
"deleted",
"from",
"table",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_db.py#L173-L177 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cpnr/cpnr_dhcp_relay_agent.py | DhcpPacket.parse | def parse(cls, buf):
"""Parse DHCP Packet.
1. To get client IP Address(ciaddr).
2. To get relaying gateway IP Address(giaddr).
3. To get DHCP Relay Agent Information Option Suboption
such as Link Selection, VSS, Server Identifier override.
"""
pkt = DhcpPack... | python | def parse(cls, buf):
"""Parse DHCP Packet.
1. To get client IP Address(ciaddr).
2. To get relaying gateway IP Address(giaddr).
3. To get DHCP Relay Agent Information Option Suboption
such as Link Selection, VSS, Server Identifier override.
"""
pkt = DhcpPack... | [
"def",
"parse",
"(",
"cls",
",",
"buf",
")",
":",
"pkt",
"=",
"DhcpPacket",
"(",
")",
"(",
"pkt",
".",
"ciaddr",
",",
")",
"=",
"cls",
".",
"struct",
"(",
"'4s'",
")",
".",
"unpack_from",
"(",
"buf",
",",
"12",
")",
"(",
"pkt",
".",
"giaddr",
... | Parse DHCP Packet.
1. To get client IP Address(ciaddr).
2. To get relaying gateway IP Address(giaddr).
3. To get DHCP Relay Agent Information Option Suboption
such as Link Selection, VSS, Server Identifier override. | [
"Parse",
"DHCP",
"Packet",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/cpnr_dhcp_relay_agent.py#L311-L348 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoDeviceManagementApi.report_dead_hosting_devices | def report_dead_hosting_devices(self, context, hd_ids=None):
"""Report that a hosting device cannot be contacted (presumed dead).
:param: context: session context
:param: hosting_device_ids: list of non-responding hosting devices
:return: None
"""
cctxt = self.client.pre... | python | def report_dead_hosting_devices(self, context, hd_ids=None):
"""Report that a hosting device cannot be contacted (presumed dead).
:param: context: session context
:param: hosting_device_ids: list of non-responding hosting devices
:return: None
"""
cctxt = self.client.pre... | [
"def",
"report_dead_hosting_devices",
"(",
"self",
",",
"context",
",",
"hd_ids",
"=",
"None",
")",
":",
"cctxt",
"=",
"self",
".",
"client",
".",
"prepare",
"(",
")",
"cctxt",
".",
"cast",
"(",
"context",
",",
"'report_non_responding_hosting_devices'",
",",
... | Report that a hosting device cannot be contacted (presumed dead).
:param: context: session context
:param: hosting_device_ids: list of non-responding hosting devices
:return: None | [
"Report",
"that",
"a",
"hosting",
"device",
"cannot",
"be",
"contacted",
"(",
"presumed",
"dead",
")",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L65-L74 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoDeviceManagementApi.register_for_duty | def register_for_duty(self, context):
"""Report that a config agent is ready for duty."""
cctxt = self.client.prepare()
return cctxt.call(context, 'register_for_duty', host=self.host) | python | def register_for_duty(self, context):
"""Report that a config agent is ready for duty."""
cctxt = self.client.prepare()
return cctxt.call(context, 'register_for_duty', host=self.host) | [
"def",
"register_for_duty",
"(",
"self",
",",
"context",
")",
":",
"cctxt",
"=",
"self",
".",
"client",
".",
"prepare",
"(",
")",
"return",
"cctxt",
".",
"call",
"(",
"context",
",",
"'register_for_duty'",
",",
"host",
"=",
"self",
".",
"host",
")"
] | Report that a config agent is ready for duty. | [
"Report",
"that",
"a",
"config",
"agent",
"is",
"ready",
"for",
"duty",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L82-L85 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoDeviceManagementApi.get_hosting_devices_for_agent | def get_hosting_devices_for_agent(self, context):
"""Get a list of hosting devices assigned to this agent."""
cctxt = self.client.prepare()
return cctxt.call(context,
'get_hosting_devices_for_agent',
host=self.host) | python | def get_hosting_devices_for_agent(self, context):
"""Get a list of hosting devices assigned to this agent."""
cctxt = self.client.prepare()
return cctxt.call(context,
'get_hosting_devices_for_agent',
host=self.host) | [
"def",
"get_hosting_devices_for_agent",
"(",
"self",
",",
"context",
")",
":",
"cctxt",
"=",
"self",
".",
"client",
".",
"prepare",
"(",
")",
"return",
"cctxt",
".",
"call",
"(",
"context",
",",
"'get_hosting_devices_for_agent'",
",",
"host",
"=",
"self",
".... | Get a list of hosting devices assigned to this agent. | [
"Get",
"a",
"list",
"of",
"hosting",
"devices",
"assigned",
"to",
"this",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L87-L92 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoCfgAgent.process_services | def process_services(self, device_ids=None, removed_devices_info=None):
"""Process services managed by this config agent.
This method is invoked by any of three scenarios.
1. Invoked by a periodic task running every `RPC_LOOP_INTERVAL`
seconds. This is the most common scenario.
... | python | def process_services(self, device_ids=None, removed_devices_info=None):
"""Process services managed by this config agent.
This method is invoked by any of three scenarios.
1. Invoked by a periodic task running every `RPC_LOOP_INTERVAL`
seconds. This is the most common scenario.
... | [
"def",
"process_services",
"(",
"self",
",",
"device_ids",
"=",
"None",
",",
"removed_devices_info",
"=",
"None",
")",
":",
"LOG",
".",
"debug",
"(",
"\"Processing services started\"",
")",
"# Now we process only routing service, additional services will be",
"# added in fu... | Process services managed by this config agent.
This method is invoked by any of three scenarios.
1. Invoked by a periodic task running every `RPC_LOOP_INTERVAL`
seconds. This is the most common scenario.
In this mode, the method is called without any arguments.
2. Called by th... | [
"Process",
"services",
"managed",
"by",
"this",
"config",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L217-L267 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoCfgAgent._process_backlogged_hosting_devices | def _process_backlogged_hosting_devices(self, context):
"""Process currently backlogged devices.
Go through the currently backlogged devices and process them.
For devices which are now reachable (compared to last time), we call
`process_services()` passing the now reachable device's id.... | python | def _process_backlogged_hosting_devices(self, context):
"""Process currently backlogged devices.
Go through the currently backlogged devices and process them.
For devices which are now reachable (compared to last time), we call
`process_services()` passing the now reachable device's id.... | [
"def",
"_process_backlogged_hosting_devices",
"(",
"self",
",",
"context",
")",
":",
"driver_mgr",
"=",
"self",
".",
"get_routing_service_helper",
"(",
")",
".",
"driver_manager",
"res",
"=",
"self",
".",
"_dev_status",
".",
"check_backlogged_hosting_devices",
"(",
... | Process currently backlogged devices.
Go through the currently backlogged devices and process them.
For devices which are now reachable (compared to last time), we call
`process_services()` passing the now reachable device's id.
For devices which have passed the `hosting_device_dead_tim... | [
"Process",
"currently",
"backlogged",
"devices",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L269-L315 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoCfgAgent.agent_updated | def agent_updated(self, context, payload):
"""Deal with agent updated RPC message."""
try:
if payload['admin_state_up']:
#TODO(hareeshp): implement agent updated handling
pass
except KeyError as e:
LOG.error("Invalid payload format for rece... | python | def agent_updated(self, context, payload):
"""Deal with agent updated RPC message."""
try:
if payload['admin_state_up']:
#TODO(hareeshp): implement agent updated handling
pass
except KeyError as e:
LOG.error("Invalid payload format for rece... | [
"def",
"agent_updated",
"(",
"self",
",",
"context",
",",
"payload",
")",
":",
"try",
":",
"if",
"payload",
"[",
"'admin_state_up'",
"]",
":",
"#TODO(hareeshp): implement agent updated handling",
"pass",
"except",
"KeyError",
"as",
"e",
":",
"LOG",
".",
"error",... | Deal with agent updated RPC message. | [
"Deal",
"with",
"agent",
"updated",
"RPC",
"message",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L317-L326 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoCfgAgent.hosting_devices_assigned_to_cfg_agent | def hosting_devices_assigned_to_cfg_agent(self, context, payload):
"""Deal with hosting devices assigned to this config agent."""
LOG.debug("Got hosting device assigned, payload: %s" % payload)
try:
if payload['hosting_device_ids']:
#TODO(hareeshp): implement assignme... | python | def hosting_devices_assigned_to_cfg_agent(self, context, payload):
"""Deal with hosting devices assigned to this config agent."""
LOG.debug("Got hosting device assigned, payload: %s" % payload)
try:
if payload['hosting_device_ids']:
#TODO(hareeshp): implement assignme... | [
"def",
"hosting_devices_assigned_to_cfg_agent",
"(",
"self",
",",
"context",
",",
"payload",
")",
":",
"LOG",
".",
"debug",
"(",
"\"Got hosting device assigned, payload: %s\"",
"%",
"payload",
")",
"try",
":",
"if",
"payload",
"[",
"'hosting_device_ids'",
"]",
":",
... | Deal with hosting devices assigned to this config agent. | [
"Deal",
"with",
"hosting",
"devices",
"assigned",
"to",
"this",
"config",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L328-L339 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoCfgAgent.hosting_devices_unassigned_from_cfg_agent | def hosting_devices_unassigned_from_cfg_agent(self, context, payload):
"""Deal with hosting devices unassigned from this config agent."""
try:
if payload['hosting_device_ids']:
#TODO(hareeshp): implement unassignment of hosting devices
pass
except KeyE... | python | def hosting_devices_unassigned_from_cfg_agent(self, context, payload):
"""Deal with hosting devices unassigned from this config agent."""
try:
if payload['hosting_device_ids']:
#TODO(hareeshp): implement unassignment of hosting devices
pass
except KeyE... | [
"def",
"hosting_devices_unassigned_from_cfg_agent",
"(",
"self",
",",
"context",
",",
"payload",
")",
":",
"try",
":",
"if",
"payload",
"[",
"'hosting_device_ids'",
"]",
":",
"#TODO(hareeshp): implement unassignment of hosting devices",
"pass",
"except",
"KeyError",
"as",... | Deal with hosting devices unassigned from this config agent. | [
"Deal",
"with",
"hosting",
"devices",
"unassigned",
"from",
"this",
"config",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L341-L351 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoCfgAgent.hosting_devices_removed | def hosting_devices_removed(self, context, payload):
"""Deal with hosting device removed RPC message."""
try:
if payload['hosting_data']:
if payload['hosting_data'].keys():
self.process_services(removed_devices_info=payload)
except KeyError as e:
... | python | def hosting_devices_removed(self, context, payload):
"""Deal with hosting device removed RPC message."""
try:
if payload['hosting_data']:
if payload['hosting_data'].keys():
self.process_services(removed_devices_info=payload)
except KeyError as e:
... | [
"def",
"hosting_devices_removed",
"(",
"self",
",",
"context",
",",
"payload",
")",
":",
"try",
":",
"if",
"payload",
"[",
"'hosting_data'",
"]",
":",
"if",
"payload",
"[",
"'hosting_data'",
"]",
".",
"keys",
"(",
")",
":",
"self",
".",
"process_services",... | Deal with hosting device removed RPC message. | [
"Deal",
"with",
"hosting",
"device",
"removed",
"RPC",
"message",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L353-L362 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoCfgAgentWithStateReport._agent_registration | def _agent_registration(self):
"""Register this agent with the server.
This method registers the cfg agent with the neutron server so hosting
devices can be assigned to it. In case the server is not ready to
accept registration (it sends a False) then we retry registration
for `... | python | def _agent_registration(self):
"""Register this agent with the server.
This method registers the cfg agent with the neutron server so hosting
devices can be assigned to it. In case the server is not ready to
accept registration (it sends a False) then we retry registration
for `... | [
"def",
"_agent_registration",
"(",
"self",
")",
":",
"for",
"attempts",
"in",
"range",
"(",
"MAX_REGISTRATION_ATTEMPTS",
")",
":",
"context",
"=",
"bc",
".",
"context",
".",
"get_admin_context_without_session",
"(",
")",
"self",
".",
"send_agent_report",
"(",
"s... | Register this agent with the server.
This method registers the cfg agent with the neutron server so hosting
devices can be assigned to it. In case the server is not ready to
accept registration (it sends a False) then we retry registration
for `MAX_REGISTRATION_ATTEMPTS` with a delay of... | [
"Register",
"this",
"agent",
"with",
"the",
"server",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L418-L454 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoCfgAgentWithStateReport._report_state | def _report_state(self):
"""Report state to the plugin.
This task run every `keepalive_interval` period.
Collects, creates and sends a summary of the services currently
managed by this agent. Data is collected from the service helper(s).
Refer the `configurations` dict for the p... | python | def _report_state(self):
"""Report state to the plugin.
This task run every `keepalive_interval` period.
Collects, creates and sends a summary of the services currently
managed by this agent. Data is collected from the service helper(s).
Refer the `configurations` dict for the p... | [
"def",
"_report_state",
"(",
"self",
")",
":",
"LOG",
".",
"debug",
"(",
"\"Report state task started\"",
")",
"self",
".",
"keepalive_iteration",
"+=",
"1",
"if",
"self",
".",
"keepalive_iteration",
"==",
"self",
".",
"report_iteration",
":",
"self",
".",
"_p... | Report state to the plugin.
This task run every `keepalive_interval` period.
Collects, creates and sends a summary of the services currently
managed by this agent. Data is collected from the service helper(s).
Refer the `configurations` dict for the parameters reported.
:return:... | [
"Report",
"state",
"to",
"the",
"plugin",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L456-L476 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py | CiscoCfgAgentWithStateReport.send_agent_report | def send_agent_report(self, report, context):
"""Send the agent report via RPC."""
try:
self.state_rpc.report_state(context, report, self.use_call)
report.pop('start_flag', None)
self.use_call = False
LOG.debug("Send agent report successfully completed")
... | python | def send_agent_report(self, report, context):
"""Send the agent report via RPC."""
try:
self.state_rpc.report_state(context, report, self.use_call)
report.pop('start_flag', None)
self.use_call = False
LOG.debug("Send agent report successfully completed")
... | [
"def",
"send_agent_report",
"(",
"self",
",",
"report",
",",
"context",
")",
":",
"try",
":",
"self",
".",
"state_rpc",
".",
"report_state",
"(",
"context",
",",
"report",
",",
"self",
".",
"use_call",
")",
"report",
".",
"pop",
"(",
"'start_flag'",
",",... | Send the agent report via RPC. | [
"Send",
"the",
"agent",
"report",
"via",
"RPC",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L496-L510 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py | CiscoUcsmMechanismDriver._get_vlanid | def _get_vlanid(self, context):
"""Returns vlan_id associated with a bound VLAN segment."""
segment = context.bottom_bound_segment
if segment and self.check_segment(segment):
return segment.get(api.SEGMENTATION_ID) | python | def _get_vlanid(self, context):
"""Returns vlan_id associated with a bound VLAN segment."""
segment = context.bottom_bound_segment
if segment and self.check_segment(segment):
return segment.get(api.SEGMENTATION_ID) | [
"def",
"_get_vlanid",
"(",
"self",
",",
"context",
")",
":",
"segment",
"=",
"context",
".",
"bottom_bound_segment",
"if",
"segment",
"and",
"self",
".",
"check_segment",
"(",
"segment",
")",
":",
"return",
"segment",
".",
"get",
"(",
"api",
".",
"SEGMENTA... | Returns vlan_id associated with a bound VLAN segment. | [
"Returns",
"vlan_id",
"associated",
"with",
"a",
"bound",
"VLAN",
"segment",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L58-L62 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py | CiscoUcsmMechanismDriver._get_physnet | def _get_physnet(self, context):
"""Returns physnet associated with a bound VLAN segment."""
segment = context.bottom_bound_segment
if segment and self.check_segment(segment):
return segment.get(api.PHYSICAL_NETWORK) | python | def _get_physnet(self, context):
"""Returns physnet associated with a bound VLAN segment."""
segment = context.bottom_bound_segment
if segment and self.check_segment(segment):
return segment.get(api.PHYSICAL_NETWORK) | [
"def",
"_get_physnet",
"(",
"self",
",",
"context",
")",
":",
"segment",
"=",
"context",
".",
"bottom_bound_segment",
"if",
"segment",
"and",
"self",
".",
"check_segment",
"(",
"segment",
")",
":",
"return",
"segment",
".",
"get",
"(",
"api",
".",
"PHYSICA... | Returns physnet associated with a bound VLAN segment. | [
"Returns",
"physnet",
"associated",
"with",
"a",
"bound",
"VLAN",
"segment",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L73-L77 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py | CiscoUcsmMechanismDriver.update_port_precommit | def update_port_precommit(self, context):
"""Adds port profile and vlan information to the DB.
Assign a port profile to this port. To do that:
1. Get the vlan_id associated with the bound segment
2. Check if a port profile already exists for this vlan_id
3. If yes, associate tha... | python | def update_port_precommit(self, context):
"""Adds port profile and vlan information to the DB.
Assign a port profile to this port. To do that:
1. Get the vlan_id associated with the bound segment
2. Check if a port profile already exists for this vlan_id
3. If yes, associate tha... | [
"def",
"update_port_precommit",
"(",
"self",
",",
"context",
")",
":",
"vnic_type",
"=",
"context",
".",
"current",
".",
"get",
"(",
"bc",
".",
"portbindings",
".",
"VNIC_TYPE",
",",
"bc",
".",
"portbindings",
".",
"VNIC_NORMAL",
")",
"profile",
"=",
"cont... | Adds port profile and vlan information to the DB.
Assign a port profile to this port. To do that:
1. Get the vlan_id associated with the bound segment
2. Check if a port profile already exists for this vlan_id
3. If yes, associate that port profile with this port.
4. If no, crea... | [
"Adds",
"port",
"profile",
"and",
"vlan",
"information",
"to",
"the",
"DB",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L79-L160 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py | CiscoUcsmMechanismDriver.update_port_postcommit | def update_port_postcommit(self, context):
"""Creates a port profile on UCS Manager.
Creates a Port Profile for this VLAN if it does not already
exist.
"""
vlan_id = self._get_vlanid(context)
if not vlan_id:
LOG.warning('Vlan_id is None. Ignoring this port.'... | python | def update_port_postcommit(self, context):
"""Creates a port profile on UCS Manager.
Creates a Port Profile for this VLAN if it does not already
exist.
"""
vlan_id = self._get_vlanid(context)
if not vlan_id:
LOG.warning('Vlan_id is None. Ignoring this port.'... | [
"def",
"update_port_postcommit",
"(",
"self",
",",
"context",
")",
":",
"vlan_id",
"=",
"self",
".",
"_get_vlanid",
"(",
"context",
")",
"if",
"not",
"vlan_id",
":",
"LOG",
".",
"warning",
"(",
"'Vlan_id is None. Ignoring this port.'",
")",
"return",
"if",
"("... | Creates a port profile on UCS Manager.
Creates a Port Profile for this VLAN if it does not already
exist. | [
"Creates",
"a",
"port",
"profile",
"on",
"UCS",
"Manager",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L162-L277 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py | CiscoUcsmMechanismDriver.delete_network_precommit | def delete_network_precommit(self, context):
"""Delete entry corresponding to Network's VLAN in the DB."""
segments = context.network_segments
for segment in segments:
if not self.check_segment(segment):
return # Not a vlan network
vlan_id = segment.get(a... | python | def delete_network_precommit(self, context):
"""Delete entry corresponding to Network's VLAN in the DB."""
segments = context.network_segments
for segment in segments:
if not self.check_segment(segment):
return # Not a vlan network
vlan_id = segment.get(a... | [
"def",
"delete_network_precommit",
"(",
"self",
",",
"context",
")",
":",
"segments",
"=",
"context",
".",
"network_segments",
"for",
"segment",
"in",
"segments",
":",
"if",
"not",
"self",
".",
"check_segment",
"(",
"segment",
")",
":",
"return",
"# Not a vlan... | Delete entry corresponding to Network's VLAN in the DB. | [
"Delete",
"entry",
"corresponding",
"to",
"Network",
"s",
"VLAN",
"in",
"the",
"DB",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L279-L300 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py | CiscoUcsmMechanismDriver.delete_network_postcommit | def delete_network_postcommit(self, context):
"""Delete all configuration added to UCS Manager for the vlan_id."""
segments = context.network_segments
network_name = context.current['name']
for segment in segments:
if not self.check_segment(segment):
return ... | python | def delete_network_postcommit(self, context):
"""Delete all configuration added to UCS Manager for the vlan_id."""
segments = context.network_segments
network_name = context.current['name']
for segment in segments:
if not self.check_segment(segment):
return ... | [
"def",
"delete_network_postcommit",
"(",
"self",
",",
"context",
")",
":",
"segments",
"=",
"context",
".",
"network_segments",
"network_name",
"=",
"context",
".",
"current",
"[",
"'name'",
"]",
"for",
"segment",
"in",
"segments",
":",
"if",
"not",
"self",
... | Delete all configuration added to UCS Manager for the vlan_id. | [
"Delete",
"all",
"configuration",
"added",
"to",
"UCS",
"Manager",
"for",
"the",
"vlan_id",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L302-L318 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py | CiscoUcsmMechanismDriver.bind_port | def bind_port(self, context):
"""Binds port to current network segment.
Binds port only if the vnic_type is direct or macvtap and
the port is from a supported vendor. While binding port set it
in ACTIVE state and provide the Port Profile or Vlan Id as part
vif_details.
"... | python | def bind_port(self, context):
"""Binds port to current network segment.
Binds port only if the vnic_type is direct or macvtap and
the port is from a supported vendor. While binding port set it
in ACTIVE state and provide the Port Profile or Vlan Id as part
vif_details.
"... | [
"def",
"bind_port",
"(",
"self",
",",
"context",
")",
":",
"vnic_type",
"=",
"context",
".",
"current",
".",
"get",
"(",
"bc",
".",
"portbindings",
".",
"VNIC_TYPE",
",",
"bc",
".",
"portbindings",
".",
"VNIC_NORMAL",
")",
"LOG",
".",
"debug",
"(",
"'A... | Binds port to current network segment.
Binds port only if the vnic_type is direct or macvtap and
the port is from a supported vendor. While binding port set it
in ACTIVE state and provide the Port Profile or Vlan Id as part
vif_details. | [
"Binds",
"port",
"to",
"current",
"network",
"segment",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L320-L371 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/iptables_driver.py | IptablesDriver.update_rule_entry | def update_rule_entry(self, rule_info):
"""Update the rule_info list."""
if rule_info.get('status') == 'up':
self.add_rule_entry(rule_info)
if rule_info.get('status') == 'down':
self.remove_rule_entry(rule_info) | python | def update_rule_entry(self, rule_info):
"""Update the rule_info list."""
if rule_info.get('status') == 'up':
self.add_rule_entry(rule_info)
if rule_info.get('status') == 'down':
self.remove_rule_entry(rule_info) | [
"def",
"update_rule_entry",
"(",
"self",
",",
"rule_info",
")",
":",
"if",
"rule_info",
".",
"get",
"(",
"'status'",
")",
"==",
"'up'",
":",
"self",
".",
"add_rule_entry",
"(",
"rule_info",
")",
"if",
"rule_info",
".",
"get",
"(",
"'status'",
")",
"==",
... | Update the rule_info list. | [
"Update",
"the",
"rule_info",
"list",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L50-L56 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/iptables_driver.py | IptablesDriver.add_rule_entry | def add_rule_entry(self, rule_info):
"""Add host data object to the rule_info list."""
new_rule = IpMacPort(rule_info.get('ip'), rule_info.get('mac'),
rule_info.get('port'))
LOG.debug('Added rule info %s to the list', rule_info)
self.rule_info.append(new_rul... | python | def add_rule_entry(self, rule_info):
"""Add host data object to the rule_info list."""
new_rule = IpMacPort(rule_info.get('ip'), rule_info.get('mac'),
rule_info.get('port'))
LOG.debug('Added rule info %s to the list', rule_info)
self.rule_info.append(new_rul... | [
"def",
"add_rule_entry",
"(",
"self",
",",
"rule_info",
")",
":",
"new_rule",
"=",
"IpMacPort",
"(",
"rule_info",
".",
"get",
"(",
"'ip'",
")",
",",
"rule_info",
".",
"get",
"(",
"'mac'",
")",
",",
"rule_info",
".",
"get",
"(",
"'port'",
")",
")",
"L... | Add host data object to the rule_info list. | [
"Add",
"host",
"data",
"object",
"to",
"the",
"rule_info",
"list",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L58-L64 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/iptables_driver.py | IptablesDriver.remove_rule_entry | def remove_rule_entry(self, rule_info):
"""Remove host data object from rule_info list."""
temp_list = list(self.rule_info)
for rule in temp_list:
if (rule.ip == rule_info.get('ip') and
rule.mac == rule_info.get('mac') and
rule.port == rule_info.g... | python | def remove_rule_entry(self, rule_info):
"""Remove host data object from rule_info list."""
temp_list = list(self.rule_info)
for rule in temp_list:
if (rule.ip == rule_info.get('ip') and
rule.mac == rule_info.get('mac') and
rule.port == rule_info.g... | [
"def",
"remove_rule_entry",
"(",
"self",
",",
"rule_info",
")",
":",
"temp_list",
"=",
"list",
"(",
"self",
".",
"rule_info",
")",
"for",
"rule",
"in",
"temp_list",
":",
"if",
"(",
"rule",
".",
"ip",
"==",
"rule_info",
".",
"get",
"(",
"'ip'",
")",
"... | Remove host data object from rule_info list. | [
"Remove",
"host",
"data",
"object",
"from",
"rule_info",
"list",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L66-L75 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/iptables_driver.py | IptablesDriver._find_chain_name | def _find_chain_name(self, mac):
"""Find a rule associated with a given mac."""
ipt_cmd = ['iptables', '-t', 'filter', '-S']
cmdo = dsl.execute(ipt_cmd, root_helper=self._root_helper,
log_output=False)
for o in cmdo.split('\n'):
if mac in o.lower()... | python | def _find_chain_name(self, mac):
"""Find a rule associated with a given mac."""
ipt_cmd = ['iptables', '-t', 'filter', '-S']
cmdo = dsl.execute(ipt_cmd, root_helper=self._root_helper,
log_output=False)
for o in cmdo.split('\n'):
if mac in o.lower()... | [
"def",
"_find_chain_name",
"(",
"self",
",",
"mac",
")",
":",
"ipt_cmd",
"=",
"[",
"'iptables'",
",",
"'-t'",
",",
"'filter'",
",",
"'-S'",
"]",
"cmdo",
"=",
"dsl",
".",
"execute",
"(",
"ipt_cmd",
",",
"root_helper",
"=",
"self",
".",
"_root_helper",
"... | Find a rule associated with a given mac. | [
"Find",
"a",
"rule",
"associated",
"with",
"a",
"given",
"mac",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L77-L88 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/iptables_driver.py | IptablesDriver._find_rule_no | def _find_rule_no(self, mac):
"""Find rule number associated with a given mac."""
ipt_cmd = ['iptables', '-L', '--line-numbers']
cmdo = dsl.execute(ipt_cmd, self._root_helper, log_output=False)
for o in cmdo.split('\n'):
if mac in o.lower():
rule_no = o.split... | python | def _find_rule_no(self, mac):
"""Find rule number associated with a given mac."""
ipt_cmd = ['iptables', '-L', '--line-numbers']
cmdo = dsl.execute(ipt_cmd, self._root_helper, log_output=False)
for o in cmdo.split('\n'):
if mac in o.lower():
rule_no = o.split... | [
"def",
"_find_rule_no",
"(",
"self",
",",
"mac",
")",
":",
"ipt_cmd",
"=",
"[",
"'iptables'",
",",
"'-L'",
",",
"'--line-numbers'",
"]",
"cmdo",
"=",
"dsl",
".",
"execute",
"(",
"ipt_cmd",
",",
"self",
".",
"_root_helper",
",",
"log_output",
"=",
"False"... | Find rule number associated with a given mac. | [
"Find",
"rule",
"number",
"associated",
"with",
"a",
"given",
"mac",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L90-L100 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/iptables_driver.py | IptablesDriver.update_ip_rule | def update_ip_rule(self, ip, mac):
"""Update a rule associated with given ip and mac."""
rule_no = self._find_rule_no(mac)
chain = self._find_chain_name(mac)
if not rule_no or not chain:
LOG.error('Failed to update ip rule for %(ip)s %(mac)s',
{'ip': ip... | python | def update_ip_rule(self, ip, mac):
"""Update a rule associated with given ip and mac."""
rule_no = self._find_rule_no(mac)
chain = self._find_chain_name(mac)
if not rule_no or not chain:
LOG.error('Failed to update ip rule for %(ip)s %(mac)s',
{'ip': ip... | [
"def",
"update_ip_rule",
"(",
"self",
",",
"ip",
",",
"mac",
")",
":",
"rule_no",
"=",
"self",
".",
"_find_rule_no",
"(",
"mac",
")",
"chain",
"=",
"self",
".",
"_find_chain_name",
"(",
"mac",
")",
"if",
"not",
"rule_no",
"or",
"not",
"chain",
":",
"... | Update a rule associated with given ip and mac. | [
"Update",
"a",
"rule",
"associated",
"with",
"given",
"ip",
"and",
"mac",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L102-L116 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/iptables_driver.py | IptablesDriver.enqueue_event | def enqueue_event(self, event):
"""Enqueue the given event.
The event contains host data (ip, mac, port) which will be used to
update the spoofing rule for the host in the iptables.
"""
LOG.debug('Enqueue iptable event %s.', event)
if event.get('status') == 'up':
... | python | def enqueue_event(self, event):
"""Enqueue the given event.
The event contains host data (ip, mac, port) which will be used to
update the spoofing rule for the host in the iptables.
"""
LOG.debug('Enqueue iptable event %s.', event)
if event.get('status') == 'up':
... | [
"def",
"enqueue_event",
"(",
"self",
",",
"event",
")",
":",
"LOG",
".",
"debug",
"(",
"'Enqueue iptable event %s.'",
",",
"event",
")",
"if",
"event",
".",
"get",
"(",
"'status'",
")",
"==",
"'up'",
":",
"for",
"rule",
"in",
"self",
".",
"rule_info",
... | Enqueue the given event.
The event contains host data (ip, mac, port) which will be used to
update the spoofing rule for the host in the iptables. | [
"Enqueue",
"the",
"given",
"event",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L118-L138 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/iptables_driver.py | IptablesDriver.update_iptables | def update_iptables(self):
"""Update iptables based on information in the rule_info."""
# Read the iptables
iptables_cmds = ['iptables-save', '-c']
all_rules = dsl.execute(iptables_cmds, root_helper=self._root_helper,
log_output=False)
# For each... | python | def update_iptables(self):
"""Update iptables based on information in the rule_info."""
# Read the iptables
iptables_cmds = ['iptables-save', '-c']
all_rules = dsl.execute(iptables_cmds, root_helper=self._root_helper,
log_output=False)
# For each... | [
"def",
"update_iptables",
"(",
"self",
")",
":",
"# Read the iptables",
"iptables_cmds",
"=",
"[",
"'iptables-save'",
",",
"'-c'",
"]",
"all_rules",
"=",
"dsl",
".",
"execute",
"(",
"iptables_cmds",
",",
"root_helper",
"=",
"self",
".",
"_root_helper",
",",
"l... | Update iptables based on information in the rule_info. | [
"Update",
"iptables",
"based",
"on",
"information",
"in",
"the",
"rule_info",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L155-L192 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/iptables_driver.py | IptablesDriver.process_rule_info | def process_rule_info(self):
"""Task responsible for processing event queue."""
while True:
try:
event = self._iptq.get(block=False)
LOG.debug('Dequeue event: %s.', event)
self.update_rule_entry(event)
except queue.Empty:
... | python | def process_rule_info(self):
"""Task responsible for processing event queue."""
while True:
try:
event = self._iptq.get(block=False)
LOG.debug('Dequeue event: %s.', event)
self.update_rule_entry(event)
except queue.Empty:
... | [
"def",
"process_rule_info",
"(",
"self",
")",
":",
"while",
"True",
":",
"try",
":",
"event",
"=",
"self",
".",
"_iptq",
".",
"get",
"(",
"block",
"=",
"False",
")",
"LOG",
".",
"debug",
"(",
"'Dequeue event: %s.'",
",",
"event",
")",
"self",
".",
"u... | Task responsible for processing event queue. | [
"Task",
"responsible",
"for",
"processing",
"event",
"queue",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L194-L206 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py | Asa5585.setup | def setup(self, **kwargs):
"""setup ASA context for an edge tenant pair. """
params = kwargs.get('params')
LOG.info("asa_setup: tenant %(tenant)s %(in_vlan)d %(out_vlan)d"
" %(in_ip)s %(in_mask)s %(out_ip)s %(out_mask)s",
{'tenant': params.get('tenant_name'),
... | python | def setup(self, **kwargs):
"""setup ASA context for an edge tenant pair. """
params = kwargs.get('params')
LOG.info("asa_setup: tenant %(tenant)s %(in_vlan)d %(out_vlan)d"
" %(in_ip)s %(in_mask)s %(out_ip)s %(out_mask)s",
{'tenant': params.get('tenant_name'),
... | [
"def",
"setup",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"params",
"=",
"kwargs",
".",
"get",
"(",
"'params'",
")",
"LOG",
".",
"info",
"(",
"\"asa_setup: tenant %(tenant)s %(in_vlan)d %(out_vlan)d\"",
"\" %(in_ip)s %(in_mask)s %(out_ip)s %(out_mask)s\"",
",",
... | setup ASA context for an edge tenant pair. | [
"setup",
"ASA",
"context",
"for",
"an",
"edge",
"tenant",
"pair",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L80-L137 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py | Asa5585.cleanup | def cleanup(self, **kwargs):
"""cleanup ASA context for an edge tenant pair. """
params = kwargs.get('params')
LOG.info("asa_cleanup: tenant %(tenant)s %(in_vlan)d %(out_vlan)d"
" %(in_ip)s %(in_mask)s %(out_ip)s %(out_mask)s",
{'tenant': params.get('tenant_name... | python | def cleanup(self, **kwargs):
"""cleanup ASA context for an edge tenant pair. """
params = kwargs.get('params')
LOG.info("asa_cleanup: tenant %(tenant)s %(in_vlan)d %(out_vlan)d"
" %(in_ip)s %(in_mask)s %(out_ip)s %(out_mask)s",
{'tenant': params.get('tenant_name... | [
"def",
"cleanup",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"params",
"=",
"kwargs",
".",
"get",
"(",
"'params'",
")",
"LOG",
".",
"info",
"(",
"\"asa_cleanup: tenant %(tenant)s %(in_vlan)d %(out_vlan)d\"",
"\" %(in_ip)s %(in_mask)s %(out_ip)s %(out_mask)s\"",
"... | cleanup ASA context for an edge tenant pair. | [
"cleanup",
"ASA",
"context",
"for",
"an",
"edge",
"tenant",
"pair",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L139-L168 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py | Asa5585.build_acl_ip | def build_acl_ip(self, network_obj):
"Build the acl for IP address. "
if str(network_obj) == '0.0.0.0/0':
acl = "any "
else:
acl = "%(ip)s %(mask)s " % {'ip': network_obj.network,
'mask': network_obj.netmask}
return acl | python | def build_acl_ip(self, network_obj):
"Build the acl for IP address. "
if str(network_obj) == '0.0.0.0/0':
acl = "any "
else:
acl = "%(ip)s %(mask)s " % {'ip': network_obj.network,
'mask': network_obj.netmask}
return acl | [
"def",
"build_acl_ip",
"(",
"self",
",",
"network_obj",
")",
":",
"if",
"str",
"(",
"network_obj",
")",
"==",
"'0.0.0.0/0'",
":",
"acl",
"=",
"\"any \"",
"else",
":",
"acl",
"=",
"\"%(ip)s %(mask)s \"",
"%",
"{",
"'ip'",
":",
"network_obj",
".",
"network",... | Build the acl for IP address. | [
"Build",
"the",
"acl",
"for",
"IP",
"address",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L219-L227 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py | Asa5585.build_acl_port | def build_acl_port(self, port, enabled=True):
"Build the acl for L4 Ports. "
if port is not None:
if ':' in port:
range = port.replace(':', ' ')
acl = "range %(range)s " % {'range': range}
else:
acl = "eq %(port)s " % {'port': port}... | python | def build_acl_port(self, port, enabled=True):
"Build the acl for L4 Ports. "
if port is not None:
if ':' in port:
range = port.replace(':', ' ')
acl = "range %(range)s " % {'range': range}
else:
acl = "eq %(port)s " % {'port': port}... | [
"def",
"build_acl_port",
"(",
"self",
",",
"port",
",",
"enabled",
"=",
"True",
")",
":",
"if",
"port",
"is",
"not",
"None",
":",
"if",
"':'",
"in",
"port",
":",
"range",
"=",
"port",
".",
"replace",
"(",
"':'",
",",
"' '",
")",
"acl",
"=",
"\"ra... | Build the acl for L4 Ports. | [
"Build",
"the",
"acl",
"for",
"L4",
"Ports",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L229-L239 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py | Asa5585.build_acl | def build_acl(self, tenant_name, rule):
"""Build the ACL. """
# TODO(padkrish) actions that is not deny or allow, throw error
if rule['action'] == 'allow':
action = 'permit'
else:
action = 'deny'
acl_str = "access-list %(tenant)s extended %(action)s %(prot... | python | def build_acl(self, tenant_name, rule):
"""Build the ACL. """
# TODO(padkrish) actions that is not deny or allow, throw error
if rule['action'] == 'allow':
action = 'permit'
else:
action = 'deny'
acl_str = "access-list %(tenant)s extended %(action)s %(prot... | [
"def",
"build_acl",
"(",
"self",
",",
"tenant_name",
",",
"rule",
")",
":",
"# TODO(padkrish) actions that is not deny or allow, throw error",
"if",
"rule",
"[",
"'action'",
"]",
"==",
"'allow'",
":",
"action",
"=",
"'permit'",
"else",
":",
"action",
"=",
"'deny'"... | Build the ACL. | [
"Build",
"the",
"ACL",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L241-L263 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py | Asa5585.apply_policy | def apply_policy(self, policy):
"""Apply a firewall policy. """
tenant_name = policy['tenant_name']
fw_id = policy['fw_id']
fw_name = policy['fw_name']
LOG.info("asa_apply_policy: tenant=%(tenant)s fw_id=%(fw_id)s "
"fw_name=%(fw_name)s",
{'tenan... | python | def apply_policy(self, policy):
"""Apply a firewall policy. """
tenant_name = policy['tenant_name']
fw_id = policy['fw_id']
fw_name = policy['fw_name']
LOG.info("asa_apply_policy: tenant=%(tenant)s fw_id=%(fw_id)s "
"fw_name=%(fw_name)s",
{'tenan... | [
"def",
"apply_policy",
"(",
"self",
",",
"policy",
")",
":",
"tenant_name",
"=",
"policy",
"[",
"'tenant_name'",
"]",
"fw_id",
"=",
"policy",
"[",
"'fw_id'",
"]",
"fw_name",
"=",
"policy",
"[",
"'fw_name'",
"]",
"LOG",
".",
"info",
"(",
"\"asa_apply_policy... | Apply a firewall policy. | [
"Apply",
"a",
"firewall",
"policy",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L265-L305 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp._flow_check_handler_internal | def _flow_check_handler_internal(self):
"""Periodic handler to check if installed flows are present.
This handler runs periodically to check if installed flows are present.
This function cannot detect and delete the stale flows, if present.
It requires more complexity to delete stale fl... | python | def _flow_check_handler_internal(self):
"""Periodic handler to check if installed flows are present.
This handler runs periodically to check if installed flows are present.
This function cannot detect and delete the stale flows, if present.
It requires more complexity to delete stale fl... | [
"def",
"_flow_check_handler_internal",
"(",
"self",
")",
":",
"integ_flow",
"=",
"self",
".",
"integ_br_obj",
".",
"dump_flows_for",
"(",
"in_port",
"=",
"self",
".",
"int_peer_port_num",
")",
"ext_flow",
"=",
"self",
".",
"ext_br_obj",
".",
"dump_flows_for",
"(... | Periodic handler to check if installed flows are present.
This handler runs periodically to check if installed flows are present.
This function cannot detect and delete the stale flows, if present.
It requires more complexity to delete stale flows. Generally, stale
flows are not present... | [
"Periodic",
"handler",
"to",
"check",
"if",
"installed",
"flows",
"are",
"present",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L205-L236 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp._flow_check_handler | def _flow_check_handler(self):
"""Top level routine to check OVS flow consistency. """
LOG.info("In _flow_check_handler")
try:
with self.ovs_vdp_lock:
self._flow_check_handler_internal()
except Exception as e:
LOG.error("Exception in _flow_check_ha... | python | def _flow_check_handler(self):
"""Top level routine to check OVS flow consistency. """
LOG.info("In _flow_check_handler")
try:
with self.ovs_vdp_lock:
self._flow_check_handler_internal()
except Exception as e:
LOG.error("Exception in _flow_check_ha... | [
"def",
"_flow_check_handler",
"(",
"self",
")",
":",
"LOG",
".",
"info",
"(",
"\"In _flow_check_handler\"",
")",
"try",
":",
"with",
"self",
".",
"ovs_vdp_lock",
":",
"self",
".",
"_flow_check_handler_internal",
"(",
")",
"except",
"Exception",
"as",
"e",
":",... | Top level routine to check OVS flow consistency. | [
"Top",
"level",
"routine",
"to",
"check",
"OVS",
"flow",
"consistency",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L238-L246 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.gen_veth_str | def gen_veth_str(self, const_str, intf_str):
"""Generate a veth string.
Concatenates the constant string with remaining available length
of interface string from trailing position.
"""
avl_len = constants.MAX_VETH_NAME - len(const_str)
if avl_len <= 0:
LOG.er... | python | def gen_veth_str(self, const_str, intf_str):
"""Generate a veth string.
Concatenates the constant string with remaining available length
of interface string from trailing position.
"""
avl_len = constants.MAX_VETH_NAME - len(const_str)
if avl_len <= 0:
LOG.er... | [
"def",
"gen_veth_str",
"(",
"self",
",",
"const_str",
",",
"intf_str",
")",
":",
"avl_len",
"=",
"constants",
".",
"MAX_VETH_NAME",
"-",
"len",
"(",
"const_str",
")",
"if",
"avl_len",
"<=",
"0",
":",
"LOG",
".",
"error",
"(",
"\"veth string name too short\""... | Generate a veth string.
Concatenates the constant string with remaining available length
of interface string from trailing position. | [
"Generate",
"a",
"veth",
"string",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L311-L323 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.setup_lldpad_ports | def setup_lldpad_ports(self):
"""Setup the flows for passing LLDP/VDP frames in OVS. """
# Creating the physical bridge and setting up patch ports is done by
# OpenStack
ovs_bridges = ovs_lib.get_bridges(self.root_helper)
if self.ext_br not in ovs_bridges or self.integ_br not in ... | python | def setup_lldpad_ports(self):
"""Setup the flows for passing LLDP/VDP frames in OVS. """
# Creating the physical bridge and setting up patch ports is done by
# OpenStack
ovs_bridges = ovs_lib.get_bridges(self.root_helper)
if self.ext_br not in ovs_bridges or self.integ_br not in ... | [
"def",
"setup_lldpad_ports",
"(",
"self",
")",
":",
"# Creating the physical bridge and setting up patch ports is done by",
"# OpenStack",
"ovs_bridges",
"=",
"ovs_lib",
".",
"get_bridges",
"(",
"self",
".",
"root_helper",
")",
"if",
"self",
".",
"ext_br",
"not",
"in",
... | Setup the flows for passing LLDP/VDP frames in OVS. | [
"Setup",
"the",
"flows",
"for",
"passing",
"LLDP",
"/",
"VDP",
"frames",
"in",
"OVS",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L325-L417 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.find_interconnect_ports | def find_interconnect_ports(self):
"""Find the internal veth or patch ports. """
phy_port_list = self.ext_br_obj.get_port_name_list()
int_port_list = self.integ_br_obj.get_port_name_list()
for port in phy_port_list:
# Use get Interface xxx type
is_patch = ovs_li... | python | def find_interconnect_ports(self):
"""Find the internal veth or patch ports. """
phy_port_list = self.ext_br_obj.get_port_name_list()
int_port_list = self.integ_br_obj.get_port_name_list()
for port in phy_port_list:
# Use get Interface xxx type
is_patch = ovs_li... | [
"def",
"find_interconnect_ports",
"(",
"self",
")",
":",
"phy_port_list",
"=",
"self",
".",
"ext_br_obj",
".",
"get_port_name_list",
"(",
")",
"int_port_list",
"=",
"self",
".",
"integ_br_obj",
".",
"get_port_name_list",
"(",
")",
"for",
"port",
"in",
"phy_port_... | Find the internal veth or patch ports. | [
"Find",
"the",
"internal",
"veth",
"or",
"patch",
"ports",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L428-L445 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.send_vdp_port_event_internal | def send_vdp_port_event_internal(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 ... | python | def send_vdp_port_event_internal(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 ... | [
"def",
"send_vdp_port_event_internal",
"(",
"self",
",",
"port_uuid",
",",
"mac",
",",
"net_uuid",
",",
"segmentation_id",
",",
"status",
",",
"oui",
")",
":",
"lldpad_port",
"=",
"self",
".",
"lldpad_info",
"if",
"not",
"lldpad_port",
":",
"fail_reason",
"=",... | 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'... | [
"Send",
"vNIC",
"UP",
"/",
"Down",
"event",
"to",
"VDP",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L560-L595 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.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: a ovslib.VifPort object.
:param net_uuid: the net_uuid this port is to be associated with.
:param segmentation_id: the VID f... | python | def send_vdp_port_event(self, port_uuid, mac, net_uuid,
segmentation_id, status, oui):
"""Send vNIC UP/Down event to VDP.
:param port: a ovslib.VifPort object.
:param net_uuid: the net_uuid this port is to be associated with.
:param segmentation_id: the VID f... | [
"def",
"send_vdp_port_event",
"(",
"self",
",",
"port_uuid",
",",
"mac",
",",
"net_uuid",
",",
"segmentation_id",
",",
"status",
",",
"oui",
")",
":",
"try",
":",
"with",
"self",
".",
"ovs_vdp_lock",
":",
"ret",
"=",
"self",
".",
"send_vdp_port_event_interna... | Send vNIC UP/Down event to VDP.
:param port: a ovslib.VifPort object.
: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' | [
"Send",
"vNIC",
"UP",
"/",
"Down",
"event",
"to",
"VDP",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L597-L615 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.get_lvid_vdp_vlan | def get_lvid_vdp_vlan(self, net_uuid, port_uuid):
"""Retrieve the Local Vlan ID and VDP Vlan. """
lvm = self.local_vlan_map.get(net_uuid)
if not lvm:
LOG.error("lvm not yet created, get_lvid_vdp_lan "
"return error")
return cconstants.INVALID_VLAN, ... | python | def get_lvid_vdp_vlan(self, net_uuid, port_uuid):
"""Retrieve the Local Vlan ID and VDP Vlan. """
lvm = self.local_vlan_map.get(net_uuid)
if not lvm:
LOG.error("lvm not yet created, get_lvid_vdp_lan "
"return error")
return cconstants.INVALID_VLAN, ... | [
"def",
"get_lvid_vdp_vlan",
"(",
"self",
",",
"net_uuid",
",",
"port_uuid",
")",
":",
"lvm",
"=",
"self",
".",
"local_vlan_map",
".",
"get",
"(",
"net_uuid",
")",
"if",
"not",
"lvm",
":",
"LOG",
".",
"error",
"(",
"\"lvm not yet created, get_lvid_vdp_lan \"",
... | Retrieve the Local Vlan ID and VDP Vlan. | [
"Retrieve",
"the",
"Local",
"Vlan",
"ID",
"and",
"VDP",
"Vlan",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L617-L629 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.unprovision_vdp_overlay_networks | def unprovision_vdp_overlay_networks(self, net_uuid, lvid, vdp_vlan, oui):
"""Unprovisions a overlay type network configured using VDP.
:param net_uuid: the uuid of the network associated with this vlan.
:lvid: Local VLAN ID
:vdp_vlan: VDP VLAN ID
:oui: OUI Parameters
""... | python | def unprovision_vdp_overlay_networks(self, net_uuid, lvid, vdp_vlan, oui):
"""Unprovisions a overlay type network configured using VDP.
:param net_uuid: the uuid of the network associated with this vlan.
:lvid: Local VLAN ID
:vdp_vlan: VDP VLAN ID
:oui: OUI Parameters
""... | [
"def",
"unprovision_vdp_overlay_networks",
"(",
"self",
",",
"net_uuid",
",",
"lvid",
",",
"vdp_vlan",
",",
"oui",
")",
":",
"# check validity",
"if",
"not",
"ovs_lib",
".",
"is_valid_vlan_tag",
"(",
"vdp_vlan",
")",
":",
"LOG",
".",
"error",
"(",
"\"Cannot un... | Unprovisions a overlay type network configured using VDP.
:param net_uuid: the uuid of the network associated with this vlan.
:lvid: Local VLAN ID
:vdp_vlan: VDP VLAN ID
:oui: OUI Parameters | [
"Unprovisions",
"a",
"overlay",
"type",
"network",
"configured",
"using",
"VDP",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L631-L649 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.vdp_vlan_change_internal | def vdp_vlan_change_internal(self, vsw_cb_data, vdp_vlan, fail_reason):
"""Callback Function from VDP when provider VLAN changes.
This will be called only during error cases when switch
reloads or when compute reloads.
"""
LOG.debug("In VDP VLAN change VLAN %s", vdp_vlan)
... | python | def vdp_vlan_change_internal(self, vsw_cb_data, vdp_vlan, fail_reason):
"""Callback Function from VDP when provider VLAN changes.
This will be called only during error cases when switch
reloads or when compute reloads.
"""
LOG.debug("In VDP VLAN change VLAN %s", vdp_vlan)
... | [
"def",
"vdp_vlan_change_internal",
"(",
"self",
",",
"vsw_cb_data",
",",
"vdp_vlan",
",",
"fail_reason",
")",
":",
"LOG",
".",
"debug",
"(",
"\"In VDP VLAN change VLAN %s\"",
",",
"vdp_vlan",
")",
"if",
"not",
"vsw_cb_data",
":",
"LOG",
".",
"error",
"(",
"\"N... | Callback Function from VDP when provider VLAN changes.
This will be called only during error cases when switch
reloads or when compute reloads. | [
"Callback",
"Function",
"from",
"VDP",
"when",
"provider",
"VLAN",
"changes",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L651-L707 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.vdp_vlan_change | def vdp_vlan_change(self, vsw_cb_data, vdp_vlan, fail_reason):
"""Callback Function from VDP when provider VLAN changes.
This will be called only during error cases when switch
reloads or when compute reloads.
"""
LOG.debug("In VDP VLAN change VLAN %s" % vdp_vlan)
try:
... | python | def vdp_vlan_change(self, vsw_cb_data, vdp_vlan, fail_reason):
"""Callback Function from VDP when provider VLAN changes.
This will be called only during error cases when switch
reloads or when compute reloads.
"""
LOG.debug("In VDP VLAN change VLAN %s" % vdp_vlan)
try:
... | [
"def",
"vdp_vlan_change",
"(",
"self",
",",
"vsw_cb_data",
",",
"vdp_vlan",
",",
"fail_reason",
")",
":",
"LOG",
".",
"debug",
"(",
"\"In VDP VLAN change VLAN %s\"",
"%",
"vdp_vlan",
")",
"try",
":",
"with",
"self",
".",
"ovs_vdp_lock",
":",
"self",
".",
"vd... | Callback Function from VDP when provider VLAN changes.
This will be called only during error cases when switch
reloads or when compute reloads. | [
"Callback",
"Function",
"from",
"VDP",
"when",
"provider",
"VLAN",
"changes",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L709-L721 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.provision_vdp_overlay_networks | def provision_vdp_overlay_networks(self, port_uuid, mac, net_uuid,
segmentation_id, lvid, oui):
"""Provisions a overlay type network configured using VDP.
:param port_uuid: the uuid of the VM port.
:param mac: the MAC address of the VM.
:param net_... | python | def provision_vdp_overlay_networks(self, port_uuid, mac, net_uuid,
segmentation_id, lvid, oui):
"""Provisions a overlay type network configured using VDP.
:param port_uuid: the uuid of the VM port.
:param mac: the MAC address of the VM.
:param net_... | [
"def",
"provision_vdp_overlay_networks",
"(",
"self",
",",
"port_uuid",
",",
"mac",
",",
"net_uuid",
",",
"segmentation_id",
",",
"lvid",
",",
"oui",
")",
":",
"lldpad_port",
"=",
"self",
".",
"lldpad_info",
"if",
"lldpad_port",
":",
"ovs_cb_data",
"=",
"{",
... | Provisions a overlay type network configured using VDP.
:param port_uuid: the uuid of the VM port.
:param mac: the MAC address of the VM.
:param net_uuid: the uuid of the network associated with this vlan.
:param segmentation_id: the VID for 'vlan' or tunnel ID for 'tunnel'
:lvi... | [
"Provisions",
"a",
"overlay",
"type",
"network",
"configured",
"using",
"VDP",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L723-L759 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/vdp/ovs_vdp.py | OVSNeutronVdp.pop_local_cache | def pop_local_cache(self, port_uuid, mac, net_uuid, lvid, vdp_vlan,
segmentation_id):
"""Populate the local cache after restart. """
LOG.info("Populating the OVS VDP cache with port %(port_uuid)s, "
"mac %(mac)s net %(net_uuid)s lvid %(lvid)s vdpvlan "
... | python | def pop_local_cache(self, port_uuid, mac, net_uuid, lvid, vdp_vlan,
segmentation_id):
"""Populate the local cache after restart. """
LOG.info("Populating the OVS VDP cache with port %(port_uuid)s, "
"mac %(mac)s net %(net_uuid)s lvid %(lvid)s vdpvlan "
... | [
"def",
"pop_local_cache",
"(",
"self",
",",
"port_uuid",
",",
"mac",
",",
"net_uuid",
",",
"lvid",
",",
"vdp_vlan",
",",
"segmentation_id",
")",
":",
"LOG",
".",
"info",
"(",
"\"Populating the OVS VDP cache with port %(port_uuid)s, \"",
"\"mac %(mac)s net %(net_uuid)s l... | Populate the local cache after restart. | [
"Populate",
"the",
"local",
"cache",
"after",
"restart",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L761-L778 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.store_dummy_router_net | def store_dummy_router_net(self, net_id, subnet_id, rtr_id):
"""Storing the router attributes. """
self.dummy_net_id = net_id
self.dummy_subnet_id = subnet_id
self.dummy_router_id = rtr_id | python | def store_dummy_router_net(self, net_id, subnet_id, rtr_id):
"""Storing the router attributes. """
self.dummy_net_id = net_id
self.dummy_subnet_id = subnet_id
self.dummy_router_id = rtr_id | [
"def",
"store_dummy_router_net",
"(",
"self",
",",
"net_id",
",",
"subnet_id",
",",
"rtr_id",
")",
":",
"self",
".",
"dummy_net_id",
"=",
"net_id",
"self",
".",
"dummy_subnet_id",
"=",
"subnet_id",
"self",
".",
"dummy_router_id",
"=",
"rtr_id"
] | Storing the router attributes. | [
"Storing",
"the",
"router",
"attributes",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L58-L62 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.store_dcnm_net_dict | def store_dcnm_net_dict(self, net_dict, direc):
"""Storing the DCNM net dict. """
if direc == 'in':
self.in_dcnm_net_dict = net_dict
else:
self.out_dcnm_net_dict = net_dict | python | def store_dcnm_net_dict(self, net_dict, direc):
"""Storing the DCNM net dict. """
if direc == 'in':
self.in_dcnm_net_dict = net_dict
else:
self.out_dcnm_net_dict = net_dict | [
"def",
"store_dcnm_net_dict",
"(",
"self",
",",
"net_dict",
",",
"direc",
")",
":",
"if",
"direc",
"==",
"'in'",
":",
"self",
".",
"in_dcnm_net_dict",
"=",
"net_dict",
"else",
":",
"self",
".",
"out_dcnm_net_dict",
"=",
"net_dict"
] | Storing the DCNM net dict. | [
"Storing",
"the",
"DCNM",
"net",
"dict",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L71-L76 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap._parse_subnet | def _parse_subnet(self, subnet_dict):
"""Return the subnet, start, end, gateway of a subnet. """
if not subnet_dict:
return
alloc_pool = subnet_dict.get('allocation_pools')
cidr = subnet_dict.get('cidr')
subnet = cidr.split('/')[0]
start = alloc_pool[0].get('s... | python | def _parse_subnet(self, subnet_dict):
"""Return the subnet, start, end, gateway of a subnet. """
if not subnet_dict:
return
alloc_pool = subnet_dict.get('allocation_pools')
cidr = subnet_dict.get('cidr')
subnet = cidr.split('/')[0]
start = alloc_pool[0].get('s... | [
"def",
"_parse_subnet",
"(",
"self",
",",
"subnet_dict",
")",
":",
"if",
"not",
"subnet_dict",
":",
"return",
"alloc_pool",
"=",
"subnet_dict",
".",
"get",
"(",
"'allocation_pools'",
")",
"cidr",
"=",
"subnet_dict",
".",
"get",
"(",
"'cidr'",
")",
"subnet",
... | Return the subnet, start, end, gateway of a subnet. | [
"Return",
"the",
"subnet",
"start",
"end",
"gateway",
"of",
"a",
"subnet",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L85-L97 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.store_dcnm_subnet_dict | def store_dcnm_subnet_dict(self, subnet_dict, direc):
"""Store the subnet attributes and dict. """
if direc == 'in':
self.in_dcnm_subnet_dict = subnet_dict
self.in_subnet_dict = self._parse_subnet(subnet_dict)
else:
self.out_dcnm_subnet_dict = subnet_dict
... | python | def store_dcnm_subnet_dict(self, subnet_dict, direc):
"""Store the subnet attributes and dict. """
if direc == 'in':
self.in_dcnm_subnet_dict = subnet_dict
self.in_subnet_dict = self._parse_subnet(subnet_dict)
else:
self.out_dcnm_subnet_dict = subnet_dict
... | [
"def",
"store_dcnm_subnet_dict",
"(",
"self",
",",
"subnet_dict",
",",
"direc",
")",
":",
"if",
"direc",
"==",
"'in'",
":",
"self",
".",
"in_dcnm_subnet_dict",
"=",
"subnet_dict",
"self",
".",
"in_subnet_dict",
"=",
"self",
".",
"_parse_subnet",
"(",
"subnet_d... | Store the subnet attributes and dict. | [
"Store",
"the",
"subnet",
"attributes",
"and",
"dict",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L99-L106 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.create_fw_db | def create_fw_db(self, fw_id, fw_name, tenant_id):
"""Create FW dict. """
fw_dict = {'fw_id': fw_id, 'name': fw_name, 'tenant_id': tenant_id}
# FW DB is already created by FW Mgr
# self.add_fw_db(fw_id, fw_dict)
self.update_fw_dict(fw_dict) | python | def create_fw_db(self, fw_id, fw_name, tenant_id):
"""Create FW dict. """
fw_dict = {'fw_id': fw_id, 'name': fw_name, 'tenant_id': tenant_id}
# FW DB is already created by FW Mgr
# self.add_fw_db(fw_id, fw_dict)
self.update_fw_dict(fw_dict) | [
"def",
"create_fw_db",
"(",
"self",
",",
"fw_id",
",",
"fw_name",
",",
"tenant_id",
")",
":",
"fw_dict",
"=",
"{",
"'fw_id'",
":",
"fw_id",
",",
"'name'",
":",
"fw_name",
",",
"'tenant_id'",
":",
"tenant_id",
"}",
"# FW DB is already created by FW Mgr",
"# sel... | Create FW dict. | [
"Create",
"FW",
"dict",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L140-L145 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.destroy_local_fw_db | def destroy_local_fw_db(self):
"""Delete the FW dict and its attributes. """
del self.fw_dict
del self.in_dcnm_net_dict
del self.in_dcnm_subnet_dict
del self.out_dcnm_net_dict
del self.out_dcnm_subnet_dict | python | def destroy_local_fw_db(self):
"""Delete the FW dict and its attributes. """
del self.fw_dict
del self.in_dcnm_net_dict
del self.in_dcnm_subnet_dict
del self.out_dcnm_net_dict
del self.out_dcnm_subnet_dict | [
"def",
"destroy_local_fw_db",
"(",
"self",
")",
":",
"del",
"self",
".",
"fw_dict",
"del",
"self",
".",
"in_dcnm_net_dict",
"del",
"self",
".",
"in_dcnm_subnet_dict",
"del",
"self",
".",
"out_dcnm_net_dict",
"del",
"self",
".",
"out_dcnm_subnet_dict"
] | Delete the FW dict and its attributes. | [
"Delete",
"the",
"FW",
"dict",
"and",
"its",
"attributes",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L147-L153 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.update_fw_local_cache | def update_fw_local_cache(self, net, direc, start):
"""Update the fw dict with Net ID and service IP. """
fw_dict = self.get_fw_dict()
if direc == 'in':
fw_dict.update({'in_network_id': net, 'in_service_ip': start})
else:
fw_dict.update({'out_network_id': net, 'ou... | python | def update_fw_local_cache(self, net, direc, start):
"""Update the fw dict with Net ID and service IP. """
fw_dict = self.get_fw_dict()
if direc == 'in':
fw_dict.update({'in_network_id': net, 'in_service_ip': start})
else:
fw_dict.update({'out_network_id': net, 'ou... | [
"def",
"update_fw_local_cache",
"(",
"self",
",",
"net",
",",
"direc",
",",
"start",
")",
":",
"fw_dict",
"=",
"self",
".",
"get_fw_dict",
"(",
")",
"if",
"direc",
"==",
"'in'",
":",
"fw_dict",
".",
"update",
"(",
"{",
"'in_network_id'",
":",
"net",
",... | Update the fw dict with Net ID and service IP. | [
"Update",
"the",
"fw",
"dict",
"with",
"Net",
"ID",
"and",
"service",
"IP",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L155-L162 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.update_fw_local_result_str | def update_fw_local_result_str(self, os_result=None, dcnm_result=None,
dev_result=None):
"""Update the FW result in the dict. """
fw_dict = self.get_fw_dict()
if os_result is not None:
fw_dict['os_status'] = os_result
if dcnm_result is not N... | python | def update_fw_local_result_str(self, os_result=None, dcnm_result=None,
dev_result=None):
"""Update the FW result in the dict. """
fw_dict = self.get_fw_dict()
if os_result is not None:
fw_dict['os_status'] = os_result
if dcnm_result is not N... | [
"def",
"update_fw_local_result_str",
"(",
"self",
",",
"os_result",
"=",
"None",
",",
"dcnm_result",
"=",
"None",
",",
"dev_result",
"=",
"None",
")",
":",
"fw_dict",
"=",
"self",
".",
"get_fw_dict",
"(",
")",
"if",
"os_result",
"is",
"not",
"None",
":",
... | Update the FW result in the dict. | [
"Update",
"the",
"FW",
"result",
"in",
"the",
"dict",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L164-L174 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.update_fw_local_result | def update_fw_local_result(self, os_result=None, dcnm_result=None,
dev_result=None):
"""Retrieve and update the FW result in the dict. """
self.update_fw_local_result_str(os_result=os_result,
dcnm_result=dcnm_result,
... | python | def update_fw_local_result(self, os_result=None, dcnm_result=None,
dev_result=None):
"""Retrieve and update the FW result in the dict. """
self.update_fw_local_result_str(os_result=os_result,
dcnm_result=dcnm_result,
... | [
"def",
"update_fw_local_result",
"(",
"self",
",",
"os_result",
"=",
"None",
",",
"dcnm_result",
"=",
"None",
",",
"dev_result",
"=",
"None",
")",
":",
"self",
".",
"update_fw_local_result_str",
"(",
"os_result",
"=",
"os_result",
",",
"dcnm_result",
"=",
"dcn... | Retrieve and update the FW result in the dict. | [
"Retrieve",
"and",
"update",
"the",
"FW",
"result",
"in",
"the",
"dict",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L176-L181 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.update_fw_local_router | def update_fw_local_router(self, net_id, subnet_id, router_id, os_result):
"""Update the FW with router attributes. """
fw_dict = self.get_fw_dict()
fw_dict.update({'router_id': router_id, 'router_net_id': net_id,
'router_subnet_id': subnet_id})
self.store_dummy_r... | python | def update_fw_local_router(self, net_id, subnet_id, router_id, os_result):
"""Update the FW with router attributes. """
fw_dict = self.get_fw_dict()
fw_dict.update({'router_id': router_id, 'router_net_id': net_id,
'router_subnet_id': subnet_id})
self.store_dummy_r... | [
"def",
"update_fw_local_router",
"(",
"self",
",",
"net_id",
",",
"subnet_id",
",",
"router_id",
",",
"os_result",
")",
":",
"fw_dict",
"=",
"self",
".",
"get_fw_dict",
"(",
")",
"fw_dict",
".",
"update",
"(",
"{",
"'router_id'",
":",
"router_id",
",",
"'r... | Update the FW with router attributes. | [
"Update",
"the",
"FW",
"with",
"router",
"attributes",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L183-L189 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.commit_fw_db | def commit_fw_db(self):
"""Calls routine to update the FW DB. """
fw_dict = self.get_fw_dict()
self.update_fw_db(fw_dict.get('fw_id'), fw_dict) | python | def commit_fw_db(self):
"""Calls routine to update the FW DB. """
fw_dict = self.get_fw_dict()
self.update_fw_db(fw_dict.get('fw_id'), fw_dict) | [
"def",
"commit_fw_db",
"(",
"self",
")",
":",
"fw_dict",
"=",
"self",
".",
"get_fw_dict",
"(",
")",
"self",
".",
"update_fw_db",
"(",
"fw_dict",
".",
"get",
"(",
"'fw_id'",
")",
",",
"fw_dict",
")"
] | Calls routine to update the FW DB. | [
"Calls",
"routine",
"to",
"update",
"the",
"FW",
"DB",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L191-L194 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.commit_fw_db_result | def commit_fw_db_result(self):
"""Calls routine to update the FW create/delete result in DB. """
fw_dict = self.get_fw_dict()
self.update_fw_db_result(fw_dict.get('fw_id'), fw_dict) | python | def commit_fw_db_result(self):
"""Calls routine to update the FW create/delete result in DB. """
fw_dict = self.get_fw_dict()
self.update_fw_db_result(fw_dict.get('fw_id'), fw_dict) | [
"def",
"commit_fw_db_result",
"(",
"self",
")",
":",
"fw_dict",
"=",
"self",
".",
"get_fw_dict",
"(",
")",
"self",
".",
"update_fw_db_result",
"(",
"fw_dict",
".",
"get",
"(",
"'fw_id'",
")",
",",
"fw_dict",
")"
] | Calls routine to update the FW create/delete result in DB. | [
"Calls",
"routine",
"to",
"update",
"the",
"FW",
"create",
"/",
"delete",
"result",
"in",
"DB",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L196-L199 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.get_store_local_final_result | def get_store_local_final_result(self):
"""Store/Retrieve the final result.
Retrieve the final result for FW create/delete from DB and store it
locally.
"""
fw_dict = self.get_fw_dict()
fw_data, fw_data_dict = self.get_fw(fw_dict.get('fw_id'))
res = fw_data.resul... | python | def get_store_local_final_result(self):
"""Store/Retrieve the final result.
Retrieve the final result for FW create/delete from DB and store it
locally.
"""
fw_dict = self.get_fw_dict()
fw_data, fw_data_dict = self.get_fw(fw_dict.get('fw_id'))
res = fw_data.resul... | [
"def",
"get_store_local_final_result",
"(",
"self",
")",
":",
"fw_dict",
"=",
"self",
".",
"get_fw_dict",
"(",
")",
"fw_data",
",",
"fw_data_dict",
"=",
"self",
".",
"get_fw",
"(",
"fw_dict",
".",
"get",
"(",
"'fw_id'",
")",
")",
"res",
"=",
"fw_data",
"... | Store/Retrieve the final result.
Retrieve the final result for FW create/delete from DB and store it
locally. | [
"Store",
"/",
"Retrieve",
"the",
"final",
"result",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L205-L214 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.store_state | def store_state(self, state, popl_db=True):
"""Store the state of FW create/del operation. """
self.state = state
if popl_db:
fw_dict = self.get_fw_dict()
self.append_state_final_result(fw_dict.get('fw_id'),
self.get_local_final_... | python | def store_state(self, state, popl_db=True):
"""Store the state of FW create/del operation. """
self.state = state
if popl_db:
fw_dict = self.get_fw_dict()
self.append_state_final_result(fw_dict.get('fw_id'),
self.get_local_final_... | [
"def",
"store_state",
"(",
"self",
",",
"state",
",",
"popl_db",
"=",
"True",
")",
":",
"self",
".",
"state",
"=",
"state",
"if",
"popl_db",
":",
"fw_dict",
"=",
"self",
".",
"get_fw_dict",
"(",
")",
"self",
".",
"append_state_final_result",
"(",
"fw_dic... | Store the state of FW create/del operation. | [
"Store",
"the",
"state",
"of",
"FW",
"create",
"/",
"del",
"operation",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L220-L227 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | ServiceIpSegTenantMap.fixup_state | def fixup_state(self, from_str, state):
"""Fixup state after retart.
Fixup the state, if Delete is called when create SM is half-way
through.
"""
result = self.get_local_final_result()
if from_str == fw_const.FW_CR_OP:
if result == fw_const.RESULT_FW_DELETE_I... | python | def fixup_state(self, from_str, state):
"""Fixup state after retart.
Fixup the state, if Delete is called when create SM is half-way
through.
"""
result = self.get_local_final_result()
if from_str == fw_const.FW_CR_OP:
if result == fw_const.RESULT_FW_DELETE_I... | [
"def",
"fixup_state",
"(",
"self",
",",
"from_str",
",",
"state",
")",
":",
"result",
"=",
"self",
".",
"get_local_final_result",
"(",
")",
"if",
"from_str",
"==",
"fw_const",
".",
"FW_CR_OP",
":",
"if",
"result",
"==",
"fw_const",
".",
"RESULT_FW_DELETE_INI... | Fixup state after retart.
Fixup the state, if Delete is called when create SM is half-way
through. | [
"Fixup",
"state",
"after",
"retart",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L229-L242 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.store_db_obj | def store_db_obj(cls, in_obj, out_obj):
"""Store the IP DB object. """
cls.ip_db_obj['in'] = in_obj
cls.ip_db_obj['out'] = out_obj | python | def store_db_obj(cls, in_obj, out_obj):
"""Store the IP DB object. """
cls.ip_db_obj['in'] = in_obj
cls.ip_db_obj['out'] = out_obj | [
"def",
"store_db_obj",
"(",
"cls",
",",
"in_obj",
",",
"out_obj",
")",
":",
"cls",
".",
"ip_db_obj",
"[",
"'in'",
"]",
"=",
"in_obj",
"cls",
".",
"ip_db_obj",
"[",
"'out'",
"]",
"=",
"out_obj"
] | Store the IP DB object. | [
"Store",
"the",
"IP",
"DB",
"object",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L265-L268 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_in_ip_addr | def get_in_ip_addr(cls, tenant_id):
"""Retrieves the 'in' service subnet attributes. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = cls.serv_obj_dict.get(tenant_id)
return tenant_obj.get_in_... | python | def get_in_ip_addr(cls, tenant_id):
"""Retrieves the 'in' service subnet attributes. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = cls.serv_obj_dict.get(tenant_id)
return tenant_obj.get_in_... | [
"def",
"get_in_ip_addr",
"(",
"cls",
",",
"tenant_id",
")",
":",
"if",
"tenant_id",
"not",
"in",
"cls",
".",
"serv_obj_dict",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"tenant_obj",
"=",
"cls",
"."... | Retrieves the 'in' service subnet attributes. | [
"Retrieves",
"the",
"in",
"service",
"subnet",
"attributes",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L271-L277 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_out_ip_addr | def get_out_ip_addr(cls, tenant_id):
"""Retrieves the 'out' service subnet attributes. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = cls.serv_obj_dict.get(tenant_id)
return tenant_obj.get_o... | python | def get_out_ip_addr(cls, tenant_id):
"""Retrieves the 'out' service subnet attributes. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = cls.serv_obj_dict.get(tenant_id)
return tenant_obj.get_o... | [
"def",
"get_out_ip_addr",
"(",
"cls",
",",
"tenant_id",
")",
":",
"if",
"tenant_id",
"not",
"in",
"cls",
".",
"serv_obj_dict",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"tenant_obj",
"=",
"cls",
".... | Retrieves the 'out' service subnet attributes. | [
"Retrieves",
"the",
"out",
"service",
"subnet",
"attributes",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L280-L286 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_in_srvc_node_ip_addr | def get_in_srvc_node_ip_addr(cls, tenant_id):
"""Retrieves the IN service node IP address. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = cls.serv_obj_dict.get(tenant_id)
in_subnet_dict = te... | python | def get_in_srvc_node_ip_addr(cls, tenant_id):
"""Retrieves the IN service node IP address. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = cls.serv_obj_dict.get(tenant_id)
in_subnet_dict = te... | [
"def",
"get_in_srvc_node_ip_addr",
"(",
"cls",
",",
"tenant_id",
")",
":",
"if",
"tenant_id",
"not",
"in",
"cls",
".",
"serv_obj_dict",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"tenant_obj",
"=",
"c... | Retrieves the IN service node IP address. | [
"Retrieves",
"the",
"IN",
"service",
"node",
"IP",
"address",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L289-L297 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_out_srvc_node_ip_addr | def get_out_srvc_node_ip_addr(cls, tenant_id):
"""Retrieves the OUT service node IP address. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = cls.serv_obj_dict.get(tenant_id)
out_subnet_dict =... | python | def get_out_srvc_node_ip_addr(cls, tenant_id):
"""Retrieves the OUT service node IP address. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = cls.serv_obj_dict.get(tenant_id)
out_subnet_dict =... | [
"def",
"get_out_srvc_node_ip_addr",
"(",
"cls",
",",
"tenant_id",
")",
":",
"if",
"tenant_id",
"not",
"in",
"cls",
".",
"serv_obj_dict",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"tenant_obj",
"=",
"... | Retrieves the OUT service node IP address. | [
"Retrieves",
"the",
"OUT",
"service",
"node",
"IP",
"address",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L300-L308 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_dummy_router_net | def get_dummy_router_net(cls, tenant_id):
"""Retrieves the dummy router network info. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = cls.serv_obj_dict.get(tenant_id)
return tenant_obj.get_du... | python | def get_dummy_router_net(cls, tenant_id):
"""Retrieves the dummy router network info. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = cls.serv_obj_dict.get(tenant_id)
return tenant_obj.get_du... | [
"def",
"get_dummy_router_net",
"(",
"cls",
",",
"tenant_id",
")",
":",
"if",
"tenant_id",
"not",
"in",
"cls",
".",
"serv_obj_dict",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"tenant_obj",
"=",
"cls",... | Retrieves the dummy router network info. | [
"Retrieves",
"the",
"dummy",
"router",
"network",
"info",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L311-L317 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_in_seg_vlan | def get_in_seg_vlan(cls, tenant_id):
"""Retrieves the IN Seg, VLAN, mob domain. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return None, None
tenant_obj = cls.serv_obj_dict.get(tenant_id)
return tenant_obj.g... | python | def get_in_seg_vlan(cls, tenant_id):
"""Retrieves the IN Seg, VLAN, mob domain. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return None, None
tenant_obj = cls.serv_obj_dict.get(tenant_id)
return tenant_obj.g... | [
"def",
"get_in_seg_vlan",
"(",
"cls",
",",
"tenant_id",
")",
":",
"if",
"tenant_id",
"not",
"in",
"cls",
".",
"serv_obj_dict",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"None",
",",
"None",
"tenant... | Retrieves the IN Seg, VLAN, mob domain. | [
"Retrieves",
"the",
"IN",
"Seg",
"VLAN",
"mob",
"domain",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L320-L326 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_out_seg_vlan | def get_out_seg_vlan(cls, tenant_id):
"""Retrieves the OUT Seg, VLAN, mob domain. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return None, None
tenant_obj = cls.serv_obj_dict.get(tenant_id)
return tenant_obj... | python | def get_out_seg_vlan(cls, tenant_id):
"""Retrieves the OUT Seg, VLAN, mob domain. """
if tenant_id not in cls.serv_obj_dict:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return None, None
tenant_obj = cls.serv_obj_dict.get(tenant_id)
return tenant_obj... | [
"def",
"get_out_seg_vlan",
"(",
"cls",
",",
"tenant_id",
")",
":",
"if",
"tenant_id",
"not",
"in",
"cls",
".",
"serv_obj_dict",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"None",
",",
"None",
"tenan... | Retrieves the OUT Seg, VLAN, mob domain. | [
"Retrieves",
"the",
"OUT",
"Seg",
"VLAN",
"mob",
"domain",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L329-L335 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_in_subnet_id | def get_in_subnet_id(cls, tenant_id):
"""Retrieve the subnet ID of IN network. """
if 'in' not in cls.ip_db_obj:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return None
db_obj = cls.ip_db_obj.get('in')
in_subnet_dict = cls.get_in_ip_addr(tenant_id)
... | python | def get_in_subnet_id(cls, tenant_id):
"""Retrieve the subnet ID of IN network. """
if 'in' not in cls.ip_db_obj:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return None
db_obj = cls.ip_db_obj.get('in')
in_subnet_dict = cls.get_in_ip_addr(tenant_id)
... | [
"def",
"get_in_subnet_id",
"(",
"cls",
",",
"tenant_id",
")",
":",
"if",
"'in'",
"not",
"in",
"cls",
".",
"ip_db_obj",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"None",
"db_obj",
"=",
"cls",
".",... | Retrieve the subnet ID of IN network. | [
"Retrieve",
"the",
"subnet",
"ID",
"of",
"IN",
"network",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L338-L346 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_out_subnet_id | def get_out_subnet_id(cls, tenant_id):
"""Retrieve the subnet ID of OUT network. """
if 'out' not in cls.ip_db_obj:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return None
db_obj = cls.ip_db_obj.get('out')
out_subnet_dict = cls.get_out_ip_addr(tenant... | python | def get_out_subnet_id(cls, tenant_id):
"""Retrieve the subnet ID of OUT network. """
if 'out' not in cls.ip_db_obj:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return None
db_obj = cls.ip_db_obj.get('out')
out_subnet_dict = cls.get_out_ip_addr(tenant... | [
"def",
"get_out_subnet_id",
"(",
"cls",
",",
"tenant_id",
")",
":",
"if",
"'out'",
"not",
"in",
"cls",
".",
"ip_db_obj",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"None",
"db_obj",
"=",
"cls",
".... | Retrieve the subnet ID of OUT network. | [
"Retrieve",
"the",
"subnet",
"ID",
"of",
"OUT",
"network",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L349-L357 |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_in_net_id | def get_in_net_id(cls, tenant_id):
"""Retrieve the network ID of IN network. """
if 'in' not in cls.ip_db_obj:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return None
db_obj = cls.ip_db_obj.get('in')
in_subnet_dict = cls.get_in_ip_addr(tenant_id)
... | python | def get_in_net_id(cls, tenant_id):
"""Retrieve the network ID of IN network. """
if 'in' not in cls.ip_db_obj:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return None
db_obj = cls.ip_db_obj.get('in')
in_subnet_dict = cls.get_in_ip_addr(tenant_id)
... | [
"def",
"get_in_net_id",
"(",
"cls",
",",
"tenant_id",
")",
":",
"if",
"'in'",
"not",
"in",
"cls",
".",
"ip_db_obj",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"None",
"db_obj",
"=",
"cls",
".",
... | Retrieve the network ID of IN network. | [
"Retrieve",
"the",
"network",
"ID",
"of",
"IN",
"network",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L360-L368 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.