repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L328-L339 | train |
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'",
"]",
":",
"pass",
"except",
"KeyError",
"as",
"e",
":",
"LOG",
".",
"error",
"(",
"\"Invalid pa... | Deal with hosting devices unassigned from this config agent. | [
"Deal",
"with",
"hosting",
"devices",
"unassigned",
"from",
"this",
"config",
"agent",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L341-L351 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L353-L362 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L418-L454 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L456-L476 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/cfg_agent.py#L496-L510 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L58-L62 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L73-L77 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L79-L160 | train |
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",
"vlan_id",
... | Delete entry corresponding to Network's VLAN in the DB. | [
"Delete",
"entry",
"corresponding",
"to",
"Network",
"s",
"VLAN",
"in",
"the",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L279-L300 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L302-L318 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/mech_cisco_ucsm.py#L320-L371 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L50-L56 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L58-L64 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L66-L75 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L77-L88 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L90-L100 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L102-L116 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L118-L138 | train |
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",
")",
":",
"iptables_cmds",
"=",
"[",
"'iptables-save'",
",",
"'-c'",
"]",
"all_rules",
"=",
"dsl",
".",
"execute",
"(",
"iptables_cmds",
",",
"root_helper",
"=",
"self",
".",
"_root_helper",
",",
"log_output",
"=",
"Fal... | Update iptables based on information in the rule_info. | [
"Update",
"iptables",
"based",
"on",
"information",
"in",
"the",
"rule_info",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L155-L192 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/iptables_driver.py#L194-L206 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L139-L168 | train |
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",
")",
":",
"\"Build the acl for IP address. \"",
"if",
"str",
"(",
"network_obj",
")",
"==",
"'0.0.0.0/0'",
":",
"acl",
"=",
"\"any \"",
"else",
":",
"acl",
"=",
"\"%(ip)s %(mask)s \"",
"%",
"{",
"'ip'",
"... | Build the acl for IP address. | [
"Build",
"the",
"acl",
"for",
"IP",
"address",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L219-L227 | train |
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",
")",
":",
"\"Build the acl for L4 Ports. \"",
"if",
"port",
"is",
"not",
"None",
":",
"if",
"':'",
"in",
"port",
":",
"range",
"=",
"port",
".",
"replace",
"(",
"':'",
",",
... | Build the acl for L4 Ports. | [
"Build",
"the",
"acl",
"for",
"L4",
"Ports",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L229-L239 | train |
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",
")",
":",
"if",
"rule",
"[",
"'action'",
"]",
"==",
"'allow'",
":",
"action",
"=",
"'permit'",
"else",
":",
"action",
"=",
"'deny'",
"acl_str",
"=",
"\"access-list %(tenant)s extended %(action)s... | Build the ACL. | [
"Build",
"the",
"ACL",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L241-L263 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/asa_rest.py#L265-L305 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L205-L236 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L238-L246 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L311-L323 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L428-L445 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L617-L629 | train |
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",
")",
":",
"if",
"not",
"ovs_lib",
".",
"is_valid_vlan_tag",
"(",
"vdp_vlan",
")",
":",
"LOG",
".",
"error",
"(",
"\"Cannot unprovision VDP Overlay ... | 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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L631-L649 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L723-L759 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/ovs_vdp.py#L761-L778 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L58-L62 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L71-L76 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L85-L97 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L99-L106 | train |
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",
"}",
"self",
".",
"update_fw_dict",
"(",
"fw_... | Create FW dict. | [
"Create",
"FW",
"dict",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L140-L145 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L147-L153 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L155-L162 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L164-L174 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L176-L181 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L183-L189 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L191-L194 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L229-L242 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L265-L268 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L271-L277 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L280-L286 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L289-L297 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L300-L308 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L311-L317 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L320-L326 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L329-L335 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L338-L346 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L349-L357 | train |
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",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L360-L368 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.get_out_net_id | def get_out_net_id(cls, tenant_id):
"""Retrieve the network 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_i... | python | def get_out_net_id(cls, tenant_id):
"""Retrieve the network 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_i... | [
"def",
"get_out_net_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 network ID of OUT network. | [
"Retrieve",
"the",
"network",
"ID",
"of",
"OUT",
"network",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L371-L379 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.is_network_source_fw | def is_network_source_fw(cls, nwk, nwk_name):
"""Check if SOURCE is FIREWALL, if yes return TRUE.
If source is None or entry not in NWK DB, check from Name.
Name should have constant AND length should match.
"""
if nwk is not None:
if nwk.source == fw_const.FW_CONST:... | python | def is_network_source_fw(cls, nwk, nwk_name):
"""Check if SOURCE is FIREWALL, if yes return TRUE.
If source is None or entry not in NWK DB, check from Name.
Name should have constant AND length should match.
"""
if nwk is not None:
if nwk.source == fw_const.FW_CONST:... | [
"def",
"is_network_source_fw",
"(",
"cls",
",",
"nwk",
",",
"nwk_name",
")",
":",
"if",
"nwk",
"is",
"not",
"None",
":",
"if",
"nwk",
".",
"source",
"==",
"fw_const",
".",
"FW_CONST",
":",
"return",
"True",
"return",
"False",
"if",
"nwk_name",
"in",
"f... | Check if SOURCE is FIREWALL, if yes return TRUE.
If source is None or entry not in NWK DB, check from Name.
Name should have constant AND length should match. | [
"Check",
"if",
"SOURCE",
"is",
"FIREWALL",
"if",
"yes",
"return",
"TRUE",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L382-L404 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricApi.is_subnet_source_fw | def is_subnet_source_fw(cls, tenant_id, subnet):
"""Check if the subnet is created as a result of any FW operation. """
cfg = config.CiscoDFAConfig().cfg
subnet = subnet.split('/')[0]
in_sub_dict = cls.get_in_ip_addr(tenant_id)
if not in_sub_dict:
return False
... | python | def is_subnet_source_fw(cls, tenant_id, subnet):
"""Check if the subnet is created as a result of any FW operation. """
cfg = config.CiscoDFAConfig().cfg
subnet = subnet.split('/')[0]
in_sub_dict = cls.get_in_ip_addr(tenant_id)
if not in_sub_dict:
return False
... | [
"def",
"is_subnet_source_fw",
"(",
"cls",
",",
"tenant_id",
",",
"subnet",
")",
":",
"cfg",
"=",
"config",
".",
"CiscoDFAConfig",
"(",
")",
".",
"cfg",
"subnet",
"=",
"subnet",
".",
"split",
"(",
"'/'",
")",
"[",
"0",
"]",
"in_sub_dict",
"=",
"cls",
... | Check if the subnet is created as a result of any FW operation. | [
"Check",
"if",
"the",
"subnet",
"is",
"created",
"as",
"a",
"result",
"of",
"any",
"FW",
"operation",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L406-L422 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.initialize_create_state_map | def initialize_create_state_map(self):
"""This is a mapping of create result message string to state. """
self.fabric_state_map = {
fw_const.INIT_STATE_STR: fw_const.OS_IN_NETWORK_STATE,
fw_const.OS_IN_NETWORK_CREATE_FAIL:
fw_const.OS_IN_NETWORK_STATE,
... | python | def initialize_create_state_map(self):
"""This is a mapping of create result message string to state. """
self.fabric_state_map = {
fw_const.INIT_STATE_STR: fw_const.OS_IN_NETWORK_STATE,
fw_const.OS_IN_NETWORK_CREATE_FAIL:
fw_const.OS_IN_NETWORK_STATE,
... | [
"def",
"initialize_create_state_map",
"(",
"self",
")",
":",
"self",
".",
"fabric_state_map",
"=",
"{",
"fw_const",
".",
"INIT_STATE_STR",
":",
"fw_const",
".",
"OS_IN_NETWORK_STATE",
",",
"fw_const",
".",
"OS_IN_NETWORK_CREATE_FAIL",
":",
"fw_const",
".",
"OS_IN_NE... | This is a mapping of create result message string to state. | [
"This",
"is",
"a",
"mapping",
"of",
"create",
"result",
"message",
"string",
"to",
"state",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L485-L520 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.initialize_delete_state_map | def initialize_delete_state_map(self):
"""This is a mapping of delete result message string to state. """
self.fabric_state_del_map = {
fw_const.INIT_STATE_STR: fw_const.OS_IN_NETWORK_STATE,
fw_const.OS_IN_NETWORK_DEL_FAIL:
fw_const.OS_IN_NETWORK_STATE,
... | python | def initialize_delete_state_map(self):
"""This is a mapping of delete result message string to state. """
self.fabric_state_del_map = {
fw_const.INIT_STATE_STR: fw_const.OS_IN_NETWORK_STATE,
fw_const.OS_IN_NETWORK_DEL_FAIL:
fw_const.OS_IN_NETWORK_STATE,
... | [
"def",
"initialize_delete_state_map",
"(",
"self",
")",
":",
"self",
".",
"fabric_state_del_map",
"=",
"{",
"fw_const",
".",
"INIT_STATE_STR",
":",
"fw_const",
".",
"OS_IN_NETWORK_STATE",
",",
"fw_const",
".",
"OS_IN_NETWORK_DEL_FAIL",
":",
"fw_const",
".",
"OS_IN_N... | This is a mapping of delete result message string to state. | [
"This",
"is",
"a",
"mapping",
"of",
"delete",
"result",
"message",
"string",
"to",
"state",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L522-L557 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.initialize_fsm | def initialize_fsm(self):
"""Initializing the Finite State Machine.
This is a mapping of state to a dict of appropriate create and delete
functions.
"""
self.fabric_fsm = {
fw_const.INIT_STATE:
[self.init_state, self.init_state],
fw_const.... | python | def initialize_fsm(self):
"""Initializing the Finite State Machine.
This is a mapping of state to a dict of appropriate create and delete
functions.
"""
self.fabric_fsm = {
fw_const.INIT_STATE:
[self.init_state, self.init_state],
fw_const.... | [
"def",
"initialize_fsm",
"(",
"self",
")",
":",
"self",
".",
"fabric_fsm",
"=",
"{",
"fw_const",
".",
"INIT_STATE",
":",
"[",
"self",
".",
"init_state",
",",
"self",
".",
"init_state",
"]",
",",
"fw_const",
".",
"OS_IN_NETWORK_STATE",
":",
"[",
"self",
"... | Initializing the Finite State Machine.
This is a mapping of state to a dict of appropriate create and delete
functions. | [
"Initializing",
"the",
"Finite",
"State",
"Machine",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L559-L585 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.store_net_db | def store_net_db(self, tenant_id, net, net_dict, result):
"""Store service network in DB. """
network_dict = {'name': net_dict.get('name'),
'config_profile': net_dict.get('config_profile'),
'segmentation_id': net_dict.get('segmentation_id'),
... | python | def store_net_db(self, tenant_id, net, net_dict, result):
"""Store service network in DB. """
network_dict = {'name': net_dict.get('name'),
'config_profile': net_dict.get('config_profile'),
'segmentation_id': net_dict.get('segmentation_id'),
... | [
"def",
"store_net_db",
"(",
"self",
",",
"tenant_id",
",",
"net",
",",
"net_dict",
",",
"result",
")",
":",
"network_dict",
"=",
"{",
"'name'",
":",
"net_dict",
".",
"get",
"(",
"'name'",
")",
",",
"'config_profile'",
":",
"net_dict",
".",
"get",
"(",
... | Store service network in DB. | [
"Store",
"service",
"network",
"in",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L605-L613 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.store_fw_db | def store_fw_db(self, tenant_id, net, subnet_dict, direc):
"""Calls the service object routine to commit the FW entry to DB. """
serv_obj = self.get_service_obj(tenant_id)
sub = subnet_dict.get('allocation_pools')[0].get('start')
serv_obj.update_fw_local_cache(net, direc, sub)
se... | python | def store_fw_db(self, tenant_id, net, subnet_dict, direc):
"""Calls the service object routine to commit the FW entry to DB. """
serv_obj = self.get_service_obj(tenant_id)
sub = subnet_dict.get('allocation_pools')[0].get('start')
serv_obj.update_fw_local_cache(net, direc, sub)
se... | [
"def",
"store_fw_db",
"(",
"self",
",",
"tenant_id",
",",
"net",
",",
"subnet_dict",
",",
"direc",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"sub",
"=",
"subnet_dict",
".",
"get",
"(",
"'allocation_pools'",
")",
"[",... | Calls the service object routine to commit the FW entry to DB. | [
"Calls",
"the",
"service",
"object",
"routine",
"to",
"commit",
"the",
"FW",
"entry",
"to",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L615-L620 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.update_fw_db_result | def update_fw_db_result(self, tenant_id, os_status=None, dcnm_status=None,
dev_status=None):
"""Update the FW DB Result and commit it in DB.
Calls the service object routine to commit the result of a FW
operation in to DB
"""
serv_obj = self.get_servi... | python | def update_fw_db_result(self, tenant_id, os_status=None, dcnm_status=None,
dev_status=None):
"""Update the FW DB Result and commit it in DB.
Calls the service object routine to commit the result of a FW
operation in to DB
"""
serv_obj = self.get_servi... | [
"def",
"update_fw_db_result",
"(",
"self",
",",
"tenant_id",
",",
"os_status",
"=",
"None",
",",
"dcnm_status",
"=",
"None",
",",
"dev_status",
"=",
"None",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"serv_obj",
".",
... | Update the FW DB Result and commit it in DB.
Calls the service object routine to commit the result of a FW
operation in to DB | [
"Update",
"the",
"FW",
"DB",
"Result",
"and",
"commit",
"it",
"in",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L622-L631 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.store_fw_db_router | def store_fw_db_router(self, tenant_id, net_id, subnet_id, router_id,
os_status):
"""Store the result of FW router operation in DB.
Calls the service object routine to commit the result of router
operation in to DB, after updating the local cache.
"""
... | python | def store_fw_db_router(self, tenant_id, net_id, subnet_id, router_id,
os_status):
"""Store the result of FW router operation in DB.
Calls the service object routine to commit the result of router
operation in to DB, after updating the local cache.
"""
... | [
"def",
"store_fw_db_router",
"(",
"self",
",",
"tenant_id",
",",
"net_id",
",",
"subnet_id",
",",
"router_id",
",",
"os_status",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"serv_obj",
".",
"update_fw_local_router",
"(",
"... | Store the result of FW router operation in DB.
Calls the service object routine to commit the result of router
operation in to DB, after updating the local cache. | [
"Store",
"the",
"result",
"of",
"FW",
"router",
"operation",
"in",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L633-L644 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.store_net_fw_db | def store_net_fw_db(self, tenant_id, net, net_dict, subnet_dict,
direc, result, os_status=None, dcnm_status=None,
dev_status=None):
"""Save the entries in Network and Firewall DB.
Stores the entries into Network DB and Firewall DB as well as update
... | python | def store_net_fw_db(self, tenant_id, net, net_dict, subnet_dict,
direc, result, os_status=None, dcnm_status=None,
dev_status=None):
"""Save the entries in Network and Firewall DB.
Stores the entries into Network DB and Firewall DB as well as update
... | [
"def",
"store_net_fw_db",
"(",
"self",
",",
"tenant_id",
",",
"net",
",",
"net_dict",
",",
"subnet_dict",
",",
"direc",
",",
"result",
",",
"os_status",
"=",
"None",
",",
"dcnm_status",
"=",
"None",
",",
"dev_status",
"=",
"None",
")",
":",
"self",
".",
... | Save the entries in Network and Firewall DB.
Stores the entries into Network DB and Firewall DB as well as update
the result of operation into FWDB. Generally called by OS operations
that wants to modify both the Net DB and FW DB. | [
"Save",
"the",
"entries",
"in",
"Network",
"and",
"Firewall",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L646-L659 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.check_allocate_ip | def check_allocate_ip(self, obj, direc):
"""This function allocates a subnet from the pool.
It first checks to see if Openstack is already using the subnet.
If yes, it retries until it finds a free subnet not used by
Openstack.
"""
subnet_lst = self.os_helper.get_all_sub... | python | def check_allocate_ip(self, obj, direc):
"""This function allocates a subnet from the pool.
It first checks to see if Openstack is already using the subnet.
If yes, it retries until it finds a free subnet not used by
Openstack.
"""
subnet_lst = self.os_helper.get_all_sub... | [
"def",
"check_allocate_ip",
"(",
"self",
",",
"obj",
",",
"direc",
")",
":",
"subnet_lst",
"=",
"self",
".",
"os_helper",
".",
"get_all_subnets_cidr",
"(",
"no_mask",
"=",
"True",
")",
"ip_next",
"=",
"obj",
".",
"allocate_subnet",
"(",
"subnet_lst",
")",
... | This function allocates a subnet from the pool.
It first checks to see if Openstack is already using the subnet.
If yes, it retries until it finds a free subnet not used by
Openstack. | [
"This",
"function",
"allocates",
"a",
"subnet",
"from",
"the",
"pool",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L695-L707 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.get_next_ip | def get_next_ip(self, tenant_id, direc):
"""Retrieve the next available subnet.
Given a tenant, it returns the service subnet values assigned
to it based on direction.
"""
# TODO(padkrish) Put in a common functionality for services.
if direc == 'in':
subnet_d... | python | def get_next_ip(self, tenant_id, direc):
"""Retrieve the next available subnet.
Given a tenant, it returns the service subnet values assigned
to it based on direction.
"""
# TODO(padkrish) Put in a common functionality for services.
if direc == 'in':
subnet_d... | [
"def",
"get_next_ip",
"(",
"self",
",",
"tenant_id",
",",
"direc",
")",
":",
"if",
"direc",
"==",
"'in'",
":",
"subnet_dict",
"=",
"self",
".",
"get_in_ip_addr",
"(",
"tenant_id",
")",
"else",
":",
"subnet_dict",
"=",
"self",
".",
"get_out_ip_addr",
"(",
... | Retrieve the next available subnet.
Given a tenant, it returns the service subnet values assigned
to it based on direction. | [
"Retrieve",
"the",
"next",
"available",
"subnet",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L709-L731 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.release_subnet | def release_subnet(self, cidr, direc):
"""Routine to release a subnet from the DB. """
if direc == 'in':
self.service_in_ip.release_subnet(cidr)
else:
self.service_out_ip.release_subnet(cidr) | python | def release_subnet(self, cidr, direc):
"""Routine to release a subnet from the DB. """
if direc == 'in':
self.service_in_ip.release_subnet(cidr)
else:
self.service_out_ip.release_subnet(cidr) | [
"def",
"release_subnet",
"(",
"self",
",",
"cidr",
",",
"direc",
")",
":",
"if",
"direc",
"==",
"'in'",
":",
"self",
".",
"service_in_ip",
".",
"release_subnet",
"(",
"cidr",
")",
"else",
":",
"self",
".",
"service_out_ip",
".",
"release_subnet",
"(",
"c... | Routine to release a subnet from the DB. | [
"Routine",
"to",
"release",
"a",
"subnet",
"from",
"the",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L733-L738 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.fill_dcnm_subnet_info | def fill_dcnm_subnet_info(self, tenant_id, subnet, start, end, gateway,
sec_gateway, direc):
"""Fills the DCNM subnet parameters.
Function that fills the subnet parameters for a tenant required by
DCNM.
"""
serv_obj = self.get_service_obj(tenant_id)... | python | def fill_dcnm_subnet_info(self, tenant_id, subnet, start, end, gateway,
sec_gateway, direc):
"""Fills the DCNM subnet parameters.
Function that fills the subnet parameters for a tenant required by
DCNM.
"""
serv_obj = self.get_service_obj(tenant_id)... | [
"def",
"fill_dcnm_subnet_info",
"(",
"self",
",",
"tenant_id",
",",
"subnet",
",",
"start",
",",
"end",
",",
"gateway",
",",
"sec_gateway",
",",
"direc",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"fw_dict",
"=",
"ser... | Fills the DCNM subnet parameters.
Function that fills the subnet parameters for a tenant required by
DCNM. | [
"Fills",
"the",
"DCNM",
"subnet",
"parameters",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L740-L765 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.retrieve_dcnm_subnet_info | def retrieve_dcnm_subnet_info(self, tenant_id, direc):
"""Retrieves the DCNM subnet info for a tenant. """
serv_obj = self.get_service_obj(tenant_id)
subnet_dict = serv_obj.get_dcnm_subnet_dict(direc)
return subnet_dict | python | def retrieve_dcnm_subnet_info(self, tenant_id, direc):
"""Retrieves the DCNM subnet info for a tenant. """
serv_obj = self.get_service_obj(tenant_id)
subnet_dict = serv_obj.get_dcnm_subnet_dict(direc)
return subnet_dict | [
"def",
"retrieve_dcnm_subnet_info",
"(",
"self",
",",
"tenant_id",
",",
"direc",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"subnet_dict",
"=",
"serv_obj",
".",
"get_dcnm_subnet_dict",
"(",
"direc",
")",
"return",
"subnet_d... | Retrieves the DCNM subnet info for a tenant. | [
"Retrieves",
"the",
"DCNM",
"subnet",
"info",
"for",
"a",
"tenant",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L767-L771 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.alloc_retrieve_subnet_info | def alloc_retrieve_subnet_info(self, tenant_id, direc):
"""Allocate and store Subnet.
This function initially checks if subnet is allocated for a tenant
for the in/out direction. If not, it calls routine to allocate a subnet
and stores it on tenant object.
"""
serv_obj =... | python | def alloc_retrieve_subnet_info(self, tenant_id, direc):
"""Allocate and store Subnet.
This function initially checks if subnet is allocated for a tenant
for the in/out direction. If not, it calls routine to allocate a subnet
and stores it on tenant object.
"""
serv_obj =... | [
"def",
"alloc_retrieve_subnet_info",
"(",
"self",
",",
"tenant_id",
",",
"direc",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"subnet_dict",
"=",
"self",
".",
"retrieve_dcnm_subnet_info",
"(",
"tenant_id",
",",
"direc",
")",... | Allocate and store Subnet.
This function initially checks if subnet is allocated for a tenant
for the in/out direction. If not, it calls routine to allocate a subnet
and stores it on tenant object. | [
"Allocate",
"and",
"store",
"Subnet",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L773-L791 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.retrieve_dcnm_net_info | def retrieve_dcnm_net_info(self, tenant_id, direc):
"""Retrieves the DCNM network info for a tenant. """
serv_obj = self.get_service_obj(tenant_id)
net_dict = serv_obj.get_dcnm_net_dict(direc)
return net_dict | python | def retrieve_dcnm_net_info(self, tenant_id, direc):
"""Retrieves the DCNM network info for a tenant. """
serv_obj = self.get_service_obj(tenant_id)
net_dict = serv_obj.get_dcnm_net_dict(direc)
return net_dict | [
"def",
"retrieve_dcnm_net_info",
"(",
"self",
",",
"tenant_id",
",",
"direc",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"net_dict",
"=",
"serv_obj",
".",
"get_dcnm_net_dict",
"(",
"direc",
")",
"return",
"net_dict"
] | Retrieves the DCNM network info for a tenant. | [
"Retrieves",
"the",
"DCNM",
"network",
"info",
"for",
"a",
"tenant",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L793-L797 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.fill_dcnm_net_info | def fill_dcnm_net_info(self, tenant_id, direc, vlan_id=0,
segmentation_id=0):
"""Fill DCNM network parameters.
Function that fills the network parameters for a tenant required by
DCNM.
"""
serv_obj = self.get_service_obj(tenant_id)
fw_dict = se... | python | def fill_dcnm_net_info(self, tenant_id, direc, vlan_id=0,
segmentation_id=0):
"""Fill DCNM network parameters.
Function that fills the network parameters for a tenant required by
DCNM.
"""
serv_obj = self.get_service_obj(tenant_id)
fw_dict = se... | [
"def",
"fill_dcnm_net_info",
"(",
"self",
",",
"tenant_id",
",",
"direc",
",",
"vlan_id",
"=",
"0",
",",
"segmentation_id",
"=",
"0",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"fw_dict",
"=",
"serv_obj",
".",
"get_fw... | Fill DCNM network parameters.
Function that fills the network parameters for a tenant required by
DCNM. | [
"Fill",
"DCNM",
"network",
"parameters",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L811-L842 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.retrieve_network_info | def retrieve_network_info(self, tenant_id, direc):
"""Retrieve the DCNM Network information.
Retrieves DCNM net dict if already filled, else, it calls
routines to fill the net info and store it in tenant obj.
"""
serv_obj = self.get_service_obj(tenant_id)
net_dict = self... | python | def retrieve_network_info(self, tenant_id, direc):
"""Retrieve the DCNM Network information.
Retrieves DCNM net dict if already filled, else, it calls
routines to fill the net info and store it in tenant obj.
"""
serv_obj = self.get_service_obj(tenant_id)
net_dict = self... | [
"def",
"retrieve_network_info",
"(",
"self",
",",
"tenant_id",
",",
"direc",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"net_dict",
"=",
"self",
".",
"retrieve_dcnm_net_info",
"(",
"tenant_id",
",",
"direc",
")",
"if",
... | Retrieve the DCNM Network information.
Retrieves DCNM net dict if already filled, else, it calls
routines to fill the net info and store it in tenant obj. | [
"Retrieve",
"the",
"DCNM",
"Network",
"information",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L844-L856 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.alloc_seg | def alloc_seg(self, net_id):
"""Allocates the segmentation ID. """
segmentation_id = self.service_segs.allocate_segmentation_id(
net_id, source=fw_const.FW_CONST)
return segmentation_id | python | def alloc_seg(self, net_id):
"""Allocates the segmentation ID. """
segmentation_id = self.service_segs.allocate_segmentation_id(
net_id, source=fw_const.FW_CONST)
return segmentation_id | [
"def",
"alloc_seg",
"(",
"self",
",",
"net_id",
")",
":",
"segmentation_id",
"=",
"self",
".",
"service_segs",
".",
"allocate_segmentation_id",
"(",
"net_id",
",",
"source",
"=",
"fw_const",
".",
"FW_CONST",
")",
"return",
"segmentation_id"
] | Allocates the segmentation ID. | [
"Allocates",
"the",
"segmentation",
"ID",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L858-L862 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.alloc_vlan | def alloc_vlan(self, net_id):
"""Allocates the vlan ID. """
vlan_id = self.service_vlans.allocate_segmentation_id(
net_id, source=fw_const.FW_CONST)
return vlan_id | python | def alloc_vlan(self, net_id):
"""Allocates the vlan ID. """
vlan_id = self.service_vlans.allocate_segmentation_id(
net_id, source=fw_const.FW_CONST)
return vlan_id | [
"def",
"alloc_vlan",
"(",
"self",
",",
"net_id",
")",
":",
"vlan_id",
"=",
"self",
".",
"service_vlans",
".",
"allocate_segmentation_id",
"(",
"net_id",
",",
"source",
"=",
"fw_const",
".",
"FW_CONST",
")",
"return",
"vlan_id"
] | Allocates the vlan ID. | [
"Allocates",
"the",
"vlan",
"ID",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L864-L868 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.update_subnet_db_info | def update_subnet_db_info(self, tenant_id, direc, net_id, subnet_id):
"""Update the subnet DB with Net and Subnet ID, given the subnet. """
subnet_dict = self.retrieve_dcnm_subnet_info(tenant_id, direc)
if not subnet_dict:
LOG.error("Subnet dict not found for tenant %s", tenant_id)
... | python | def update_subnet_db_info(self, tenant_id, direc, net_id, subnet_id):
"""Update the subnet DB with Net and Subnet ID, given the subnet. """
subnet_dict = self.retrieve_dcnm_subnet_info(tenant_id, direc)
if not subnet_dict:
LOG.error("Subnet dict not found for tenant %s", tenant_id)
... | [
"def",
"update_subnet_db_info",
"(",
"self",
",",
"tenant_id",
",",
"direc",
",",
"net_id",
",",
"subnet_id",
")",
":",
"subnet_dict",
"=",
"self",
".",
"retrieve_dcnm_subnet_info",
"(",
"tenant_id",
",",
"direc",
")",
"if",
"not",
"subnet_dict",
":",
"LOG",
... | Update the subnet DB with Net and Subnet ID, given the subnet. | [
"Update",
"the",
"subnet",
"DB",
"with",
"Net",
"and",
"Subnet",
"ID",
"given",
"the",
"subnet",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L870-L880 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.update_net_info | def update_net_info(self, tenant_id, direc, vlan_id, segmentation_id):
"""Update the DCNM netinfo with vlan and segmentation ID. """
serv_obj = self.get_service_obj(tenant_id)
net_dict = self.update_dcnm_net_info(tenant_id, direc, vlan_id,
segmentatio... | python | def update_net_info(self, tenant_id, direc, vlan_id, segmentation_id):
"""Update the DCNM netinfo with vlan and segmentation ID. """
serv_obj = self.get_service_obj(tenant_id)
net_dict = self.update_dcnm_net_info(tenant_id, direc, vlan_id,
segmentatio... | [
"def",
"update_net_info",
"(",
"self",
",",
"tenant_id",
",",
"direc",
",",
"vlan_id",
",",
"segmentation_id",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"net_dict",
"=",
"self",
".",
"update_dcnm_net_info",
"(",
"tenant_... | Update the DCNM netinfo with vlan and segmentation ID. | [
"Update",
"the",
"DCNM",
"netinfo",
"with",
"vlan",
"and",
"segmentation",
"ID",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L882-L888 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase._create_service_nwk | def _create_service_nwk(self, tenant_id, tenant_name, direc):
"""Function to create the service in network in DCNM. """
net_dict = self.retrieve_dcnm_net_info(tenant_id, direc)
net = utils.Dict2Obj(net_dict)
subnet_dict = self.retrieve_dcnm_subnet_info(tenant_id, direc)
subnet = ... | python | def _create_service_nwk(self, tenant_id, tenant_name, direc):
"""Function to create the service in network in DCNM. """
net_dict = self.retrieve_dcnm_net_info(tenant_id, direc)
net = utils.Dict2Obj(net_dict)
subnet_dict = self.retrieve_dcnm_subnet_info(tenant_id, direc)
subnet = ... | [
"def",
"_create_service_nwk",
"(",
"self",
",",
"tenant_id",
",",
"tenant_name",
",",
"direc",
")",
":",
"net_dict",
"=",
"self",
".",
"retrieve_dcnm_net_info",
"(",
"tenant_id",
",",
"direc",
")",
"net",
"=",
"utils",
".",
"Dict2Obj",
"(",
"net_dict",
")",
... | Function to create the service in network in DCNM. | [
"Function",
"to",
"create",
"the",
"service",
"in",
"network",
"in",
"DCNM",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L890-L901 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase._delete_service_nwk | def _delete_service_nwk(self, tenant_id, tenant_name, direc):
"""Function to delete the service in network in DCNM. """
net_dict = {}
if direc == 'in':
seg, vlan = self.get_in_seg_vlan(tenant_id)
net_dict['part_name'] = None
else:
seg, vlan = self.get_... | python | def _delete_service_nwk(self, tenant_id, tenant_name, direc):
"""Function to delete the service in network in DCNM. """
net_dict = {}
if direc == 'in':
seg, vlan = self.get_in_seg_vlan(tenant_id)
net_dict['part_name'] = None
else:
seg, vlan = self.get_... | [
"def",
"_delete_service_nwk",
"(",
"self",
",",
"tenant_id",
",",
"tenant_name",
",",
"direc",
")",
":",
"net_dict",
"=",
"{",
"}",
"if",
"direc",
"==",
"'in'",
":",
"seg",
",",
"vlan",
"=",
"self",
".",
"get_in_seg_vlan",
"(",
"tenant_id",
")",
"net_dic... | Function to delete the service in network in DCNM. | [
"Function",
"to",
"delete",
"the",
"service",
"in",
"network",
"in",
"DCNM",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L903-L921 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.get_dummy_router_net | def get_dummy_router_net(self, tenant_id):
"""Retrieves the dummy router information from service object. """
if tenant_id not in self.service_attr:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = self.get_service_obj(tenant_id)
retur... | python | def get_dummy_router_net(self, tenant_id):
"""Retrieves the dummy router information from service object. """
if tenant_id not in self.service_attr:
LOG.error("Fabric not prepared for tenant %s", tenant_id)
return
tenant_obj = self.get_service_obj(tenant_id)
retur... | [
"def",
"get_dummy_router_net",
"(",
"self",
",",
"tenant_id",
")",
":",
"if",
"tenant_id",
"not",
"in",
"self",
".",
"service_attr",
":",
"LOG",
".",
"error",
"(",
"\"Fabric not prepared for tenant %s\"",
",",
"tenant_id",
")",
"return",
"tenant_obj",
"=",
"self... | Retrieves the dummy router information from service object. | [
"Retrieves",
"the",
"dummy",
"router",
"information",
"from",
"service",
"object",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L923-L929 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase._create_out_partition | def _create_out_partition(self, tenant_id, tenant_name):
"""Function to create a service partition. """
vrf_prof_str = self.serv_part_vrf_prof
self.dcnm_obj.create_partition(tenant_name, fw_const.SERV_PART_NAME,
None, vrf_prof_str,
... | python | def _create_out_partition(self, tenant_id, tenant_name):
"""Function to create a service partition. """
vrf_prof_str = self.serv_part_vrf_prof
self.dcnm_obj.create_partition(tenant_name, fw_const.SERV_PART_NAME,
None, vrf_prof_str,
... | [
"def",
"_create_out_partition",
"(",
"self",
",",
"tenant_id",
",",
"tenant_name",
")",
":",
"vrf_prof_str",
"=",
"self",
".",
"serv_part_vrf_prof",
"self",
".",
"dcnm_obj",
".",
"create_partition",
"(",
"tenant_name",
",",
"fw_const",
".",
"SERV_PART_NAME",
",",
... | Function to create a service partition. | [
"Function",
"to",
"create",
"a",
"service",
"partition",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L931-L936 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase._update_partition_srvc_node_ip | def _update_partition_srvc_node_ip(self, tenant_name, srvc_ip,
vrf_prof=None, part_name=None):
"""Function to update srvc_node address of partition. """
self.dcnm_obj.update_project(tenant_name, part_name,
service_node_ip=srvc_i... | python | def _update_partition_srvc_node_ip(self, tenant_name, srvc_ip,
vrf_prof=None, part_name=None):
"""Function to update srvc_node address of partition. """
self.dcnm_obj.update_project(tenant_name, part_name,
service_node_ip=srvc_i... | [
"def",
"_update_partition_srvc_node_ip",
"(",
"self",
",",
"tenant_name",
",",
"srvc_ip",
",",
"vrf_prof",
"=",
"None",
",",
"part_name",
"=",
"None",
")",
":",
"self",
".",
"dcnm_obj",
".",
"update_project",
"(",
"tenant_name",
",",
"part_name",
",",
"service... | Function to update srvc_node address of partition. | [
"Function",
"to",
"update",
"srvc_node",
"address",
"of",
"partition",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L938-L944 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase._update_partition_dci_id | def _update_partition_dci_id(self, tenant_name, dci_id,
vrf_prof=None, part_name=None):
"""Function to update DCI ID of partition. """
self.dcnm_obj.update_project(tenant_name, part_name, dci_id=dci_id,
vrf_prof=vrf_prof) | python | def _update_partition_dci_id(self, tenant_name, dci_id,
vrf_prof=None, part_name=None):
"""Function to update DCI ID of partition. """
self.dcnm_obj.update_project(tenant_name, part_name, dci_id=dci_id,
vrf_prof=vrf_prof) | [
"def",
"_update_partition_dci_id",
"(",
"self",
",",
"tenant_name",
",",
"dci_id",
",",
"vrf_prof",
"=",
"None",
",",
"part_name",
"=",
"None",
")",
":",
"self",
".",
"dcnm_obj",
".",
"update_project",
"(",
"tenant_name",
",",
"part_name",
",",
"dci_id",
"="... | Function to update DCI ID of partition. | [
"Function",
"to",
"update",
"DCI",
"ID",
"of",
"partition",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L946-L950 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase._delete_partition | def _delete_partition(self, tenant_id, tenant_name):
"""Function to delete a service partition. """
self.dcnm_obj.delete_partition(tenant_name, fw_const.SERV_PART_NAME) | python | def _delete_partition(self, tenant_id, tenant_name):
"""Function to delete a service partition. """
self.dcnm_obj.delete_partition(tenant_name, fw_const.SERV_PART_NAME) | [
"def",
"_delete_partition",
"(",
"self",
",",
"tenant_id",
",",
"tenant_name",
")",
":",
"self",
".",
"dcnm_obj",
".",
"delete_partition",
"(",
"tenant_name",
",",
"fw_const",
".",
"SERV_PART_NAME",
")"
] | Function to delete a service partition. | [
"Function",
"to",
"delete",
"a",
"service",
"partition",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L977-L979 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.allocate_seg_vlan | def allocate_seg_vlan(self, net_id, is_fw_virt, direc, tenant_id):
"""allocate segmentation ID and VLAN ID.
Allocate vlan, seg thereby storing NetID atomically.
This saves an extra step to update DB with NetID after allocation.
Also may save an extra step after restart, if process crash... | python | def allocate_seg_vlan(self, net_id, is_fw_virt, direc, tenant_id):
"""allocate segmentation ID and VLAN ID.
Allocate vlan, seg thereby storing NetID atomically.
This saves an extra step to update DB with NetID after allocation.
Also may save an extra step after restart, if process crash... | [
"def",
"allocate_seg_vlan",
"(",
"self",
",",
"net_id",
",",
"is_fw_virt",
",",
"direc",
",",
"tenant_id",
")",
":",
"seg",
"=",
"self",
".",
"alloc_seg",
"(",
"net_id",
")",
"vlan",
"=",
"0",
"if",
"not",
"is_fw_virt",
":",
"vlan",
"=",
"self",
".",
... | allocate segmentation ID and VLAN ID.
Allocate vlan, seg thereby storing NetID atomically.
This saves an extra step to update DB with NetID after allocation.
Also may save an extra step after restart, if process crashed
after allocation but before updating DB with NetID. Now, since
... | [
"allocate",
"segmentation",
"ID",
"and",
"VLAN",
"ID",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L981-L996 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.create_openstack_network | def create_openstack_network(self, subnet, network, tenant_id,
tenant_name, direction):
"""Helper function to create openstack network.
The net_id and subnet_id is returned. Upon failure, the subnet is
deallocated.
"""
try:
gw = str(n... | python | def create_openstack_network(self, subnet, network, tenant_id,
tenant_name, direction):
"""Helper function to create openstack network.
The net_id and subnet_id is returned. Upon failure, the subnet is
deallocated.
"""
try:
gw = str(n... | [
"def",
"create_openstack_network",
"(",
"self",
",",
"subnet",
",",
"network",
",",
"tenant_id",
",",
"tenant_name",
",",
"direction",
")",
":",
"try",
":",
"gw",
"=",
"str",
"(",
"netaddr",
".",
"IPAddress",
"(",
"subnet",
"[",
"'cidr'",
"]",
".",
"spli... | Helper function to create openstack network.
The net_id and subnet_id is returned. Upon failure, the subnet is
deallocated. | [
"Helper",
"function",
"to",
"create",
"openstack",
"network",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L998-L1019 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase._create_os_nwk | def _create_os_nwk(self, tenant_id, tenant_name, direc, is_fw_virt=False):
"""Function to create Openstack network.
This function does the following:
1. Allocate an IP address with the net_id/subnet_id not filled in the
DB.
2. Fill network parameters w/o vlan, segmentation_id... | python | def _create_os_nwk(self, tenant_id, tenant_name, direc, is_fw_virt=False):
"""Function to create Openstack network.
This function does the following:
1. Allocate an IP address with the net_id/subnet_id not filled in the
DB.
2. Fill network parameters w/o vlan, segmentation_id... | [
"def",
"_create_os_nwk",
"(",
"self",
",",
"tenant_id",
",",
"tenant_name",
",",
"direc",
",",
"is_fw_virt",
"=",
"False",
")",
":",
"subnet",
"=",
"self",
".",
"alloc_retrieve_subnet_info",
"(",
"tenant_id",
",",
"direc",
")",
"network",
"=",
"self",
".",
... | Function to create Openstack network.
This function does the following:
1. Allocate an IP address with the net_id/subnet_id not filled in the
DB.
2. Fill network parameters w/o vlan, segmentation_id, because we don't
have net_id to store in DB.
3. Create a Openstac... | [
"Function",
"to",
"create",
"Openstack",
"network",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L1021-L1045 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase._attach_dummy_intf_rtr | def _attach_dummy_intf_rtr(self, tenant_id, tenant_name, rtr_id):
"""Function to create a dummy router and interface. """
serv_obj = self.get_service_obj(tenant_id)
fw_dict = serv_obj.get_fw_dict()
fw_id = fw_dict.get('fw_id')
rtr_nwk = fw_id[0:4] + fw_const.DUMMY_SERVICE_NWK + (... | python | def _attach_dummy_intf_rtr(self, tenant_id, tenant_name, rtr_id):
"""Function to create a dummy router and interface. """
serv_obj = self.get_service_obj(tenant_id)
fw_dict = serv_obj.get_fw_dict()
fw_id = fw_dict.get('fw_id')
rtr_nwk = fw_id[0:4] + fw_const.DUMMY_SERVICE_NWK + (... | [
"def",
"_attach_dummy_intf_rtr",
"(",
"self",
",",
"tenant_id",
",",
"tenant_name",
",",
"rtr_id",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"fw_dict",
"=",
"serv_obj",
".",
"get_fw_dict",
"(",
")",
"fw_id",
"=",
"fw_d... | Function to create a dummy router and interface. | [
"Function",
"to",
"create",
"a",
"dummy",
"router",
"and",
"interface",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L1047-L1072 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase._delete_dummy_intf_rtr | def _delete_dummy_intf_rtr(self, tenant_id, tenant_name, rtr_id):
"""Function to delete a dummy interface of a router. """
dummy_router_dict = self.get_dummy_router_net(tenant_id)
ret = self.delete_os_dummy_rtr_nwk(dummy_router_dict.get('router_id'),
du... | python | def _delete_dummy_intf_rtr(self, tenant_id, tenant_name, rtr_id):
"""Function to delete a dummy interface of a router. """
dummy_router_dict = self.get_dummy_router_net(tenant_id)
ret = self.delete_os_dummy_rtr_nwk(dummy_router_dict.get('router_id'),
du... | [
"def",
"_delete_dummy_intf_rtr",
"(",
"self",
",",
"tenant_id",
",",
"tenant_name",
",",
"rtr_id",
")",
":",
"dummy_router_dict",
"=",
"self",
".",
"get_dummy_router_net",
"(",
"tenant_id",
")",
"ret",
"=",
"self",
".",
"delete_os_dummy_rtr_nwk",
"(",
"dummy_route... | Function to delete a dummy interface of a router. | [
"Function",
"to",
"delete",
"a",
"dummy",
"interface",
"of",
"a",
"router",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L1074-L1082 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.create_os_in_nwk | def create_os_in_nwk(self, tenant_id, fw_dict, is_fw_virt=False):
"""Create the Openstack IN network and stores the values in DB. """
tenant_name = fw_dict.get('tenant_name')
try:
net, subnet = self._create_os_nwk(tenant_id, tenant_name, "in",
... | python | def create_os_in_nwk(self, tenant_id, fw_dict, is_fw_virt=False):
"""Create the Openstack IN network and stores the values in DB. """
tenant_name = fw_dict.get('tenant_name')
try:
net, subnet = self._create_os_nwk(tenant_id, tenant_name, "in",
... | [
"def",
"create_os_in_nwk",
"(",
"self",
",",
"tenant_id",
",",
"fw_dict",
",",
"is_fw_virt",
"=",
"False",
")",
":",
"tenant_name",
"=",
"fw_dict",
".",
"get",
"(",
"'tenant_name'",
")",
"try",
":",
"net",
",",
"subnet",
"=",
"self",
".",
"_create_os_nwk",... | Create the Openstack IN network and stores the values in DB. | [
"Create",
"the",
"Openstack",
"IN",
"network",
"and",
"stores",
"the",
"values",
"in",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L1084-L1112 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase._delete_os_nwk | def _delete_os_nwk(self, tenant_id, tenant_name, direc, is_fw_virt=False):
"""Delete the network created in Openstack.
Function to delete Openstack network, It also releases the associated
segmentation, VLAN and subnets.
"""
serv_obj = self.get_service_obj(tenant_id)
fw_... | python | def _delete_os_nwk(self, tenant_id, tenant_name, direc, is_fw_virt=False):
"""Delete the network created in Openstack.
Function to delete Openstack network, It also releases the associated
segmentation, VLAN and subnets.
"""
serv_obj = self.get_service_obj(tenant_id)
fw_... | [
"def",
"_delete_os_nwk",
"(",
"self",
",",
"tenant_id",
",",
"tenant_name",
",",
"direc",
",",
"is_fw_virt",
"=",
"False",
")",
":",
"serv_obj",
"=",
"self",
".",
"get_service_obj",
"(",
"tenant_id",
")",
"fw_dict",
"=",
"serv_obj",
".",
"get_fw_dict",
"(",
... | Delete the network created in Openstack.
Function to delete Openstack network, It also releases the associated
segmentation, VLAN and subnets. | [
"Delete",
"the",
"network",
"created",
"in",
"Openstack",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L1144-L1186 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.delete_os_in_nwk | def delete_os_in_nwk(self, tenant_id, fw_dict, is_fw_virt=False):
"""Deletes the Openstack In network and update the DB. """
ret = True
tenant_name = fw_dict.get('tenant_name')
try:
ret = self._delete_os_nwk(tenant_id, tenant_name, "in",
... | python | def delete_os_in_nwk(self, tenant_id, fw_dict, is_fw_virt=False):
"""Deletes the Openstack In network and update the DB. """
ret = True
tenant_name = fw_dict.get('tenant_name')
try:
ret = self._delete_os_nwk(tenant_id, tenant_name, "in",
... | [
"def",
"delete_os_in_nwk",
"(",
"self",
",",
"tenant_id",
",",
"fw_dict",
",",
"is_fw_virt",
"=",
"False",
")",
":",
"ret",
"=",
"True",
"tenant_name",
"=",
"fw_dict",
".",
"get",
"(",
"'tenant_name'",
")",
"try",
":",
"ret",
"=",
"self",
".",
"_delete_o... | Deletes the Openstack In network and update the DB. | [
"Deletes",
"the",
"Openstack",
"In",
"network",
"and",
"update",
"the",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L1188-L1206 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.delete_os_out_nwk | def delete_os_out_nwk(self, tenant_id, fw_dict, is_fw_virt=False):
"""Deletes the Openstack Out network and update the DB. """
ret = True
tenant_name = fw_dict.get('tenant_name')
try:
ret = self._delete_os_nwk(tenant_id, tenant_name, "out",
... | python | def delete_os_out_nwk(self, tenant_id, fw_dict, is_fw_virt=False):
"""Deletes the Openstack Out network and update the DB. """
ret = True
tenant_name = fw_dict.get('tenant_name')
try:
ret = self._delete_os_nwk(tenant_id, tenant_name, "out",
... | [
"def",
"delete_os_out_nwk",
"(",
"self",
",",
"tenant_id",
",",
"fw_dict",
",",
"is_fw_virt",
"=",
"False",
")",
":",
"ret",
"=",
"True",
"tenant_name",
"=",
"fw_dict",
".",
"get",
"(",
"'tenant_name'",
")",
"try",
":",
"ret",
"=",
"self",
".",
"_delete_... | Deletes the Openstack Out network and update the DB. | [
"Deletes",
"the",
"Openstack",
"Out",
"network",
"and",
"update",
"the",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L1208-L1226 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.create_os_dummy_rtr | def create_os_dummy_rtr(self, tenant_id, fw_dict, is_fw_virt=False):
"""Create the dummy interface and attach it to router.
Attach the dummy interface to the Openstack router and store the
info in DB.
"""
res = fw_const.OS_DUMMY_RTR_CREATE_SUCCESS
tenant_name = fw_dict.g... | python | def create_os_dummy_rtr(self, tenant_id, fw_dict, is_fw_virt=False):
"""Create the dummy interface and attach it to router.
Attach the dummy interface to the Openstack router and store the
info in DB.
"""
res = fw_const.OS_DUMMY_RTR_CREATE_SUCCESS
tenant_name = fw_dict.g... | [
"def",
"create_os_dummy_rtr",
"(",
"self",
",",
"tenant_id",
",",
"fw_dict",
",",
"is_fw_virt",
"=",
"False",
")",
":",
"res",
"=",
"fw_const",
".",
"OS_DUMMY_RTR_CREATE_SUCCESS",
"tenant_name",
"=",
"fw_dict",
".",
"get",
"(",
"'tenant_name'",
")",
"try",
":"... | Create the dummy interface and attach it to router.
Attach the dummy interface to the Openstack router and store the
info in DB. | [
"Create",
"the",
"dummy",
"interface",
"and",
"attach",
"it",
"to",
"router",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L1228-L1260 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.delete_os_dummy_rtr | def delete_os_dummy_rtr(self, tenant_id, fw_dict, is_fw_virt=False):
"""Delete the Openstack Dummy router and store the info in DB. """
ret = True
tenant_name = fw_dict.get('tenant_name')
try:
rtr_id = fw_dict.get('router_id')
if not rtr_id:
LOG.er... | python | def delete_os_dummy_rtr(self, tenant_id, fw_dict, is_fw_virt=False):
"""Delete the Openstack Dummy router and store the info in DB. """
ret = True
tenant_name = fw_dict.get('tenant_name')
try:
rtr_id = fw_dict.get('router_id')
if not rtr_id:
LOG.er... | [
"def",
"delete_os_dummy_rtr",
"(",
"self",
",",
"tenant_id",
",",
"fw_dict",
",",
"is_fw_virt",
"=",
"False",
")",
":",
"ret",
"=",
"True",
"tenant_name",
"=",
"fw_dict",
".",
"get",
"(",
"'tenant_name'",
")",
"try",
":",
"rtr_id",
"=",
"fw_dict",
".",
"... | Delete the Openstack Dummy router and store the info in DB. | [
"Delete",
"the",
"Openstack",
"Dummy",
"router",
"and",
"store",
"the",
"info",
"in",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L1262-L1287 | train |
openstack/networking-cisco | networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py | FabricBase.create_dcnm_in_nwk | def create_dcnm_in_nwk(self, tenant_id, fw_dict, is_fw_virt=False):
"""Create the DCNM In Network and store the result in DB. """
tenant_name = fw_dict.get('tenant_name')
ret = self._create_service_nwk(tenant_id, tenant_name, 'in')
if ret:
res = fw_const.DCNM_IN_NETWORK_CREAT... | python | def create_dcnm_in_nwk(self, tenant_id, fw_dict, is_fw_virt=False):
"""Create the DCNM In Network and store the result in DB. """
tenant_name = fw_dict.get('tenant_name')
ret = self._create_service_nwk(tenant_id, tenant_name, 'in')
if ret:
res = fw_const.DCNM_IN_NETWORK_CREAT... | [
"def",
"create_dcnm_in_nwk",
"(",
"self",
",",
"tenant_id",
",",
"fw_dict",
",",
"is_fw_virt",
"=",
"False",
")",
":",
"tenant_name",
"=",
"fw_dict",
".",
"get",
"(",
"'tenant_name'",
")",
"ret",
"=",
"self",
".",
"_create_service_nwk",
"(",
"tenant_id",
","... | Create the DCNM In Network and store the result in DB. | [
"Create",
"the",
"DCNM",
"In",
"Network",
"and",
"store",
"the",
"result",
"in",
"DB",
"."
] | aa58a30aec25b86f9aa5952b0863045975debfa9 | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fabric_setup_base.py#L1289-L1302 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.