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/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.store_rule
def store_rule(self, rule_id, rule): """Store the rules. Policy is maintained as a dictionary of Rule ID. """ if rule_id not in self.rules: self.rules[rule_id] = rule self.rule_cnt += 1
python
def store_rule(self, rule_id, rule): """Store the rules. Policy is maintained as a dictionary of Rule ID. """ if rule_id not in self.rules: self.rules[rule_id] = rule self.rule_cnt += 1
[ "def", "store_rule", "(", "self", ",", "rule_id", ",", "rule", ")", ":", "if", "rule_id", "not", "in", "self", ".", "rules", ":", "self", ".", "rules", "[", "rule_id", "]", "=", "rule", "self", ".", "rule_cnt", "+=", "1" ]
Store the rules. Policy is maintained as a dictionary of Rule ID.
[ "Store", "the", "rules", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L115-L122
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.delete_rule
def delete_rule(self, rule_id): """Delete the specific Rule from dictionary indexed by rule id. """ if rule_id not in self.rules: LOG.error("No Rule id present for deleting %s", rule_id) return del self.rules[rule_id] self.rule_cnt -= 1
python
def delete_rule(self, rule_id): """Delete the specific Rule from dictionary indexed by rule id. """ if rule_id not in self.rules: LOG.error("No Rule id present for deleting %s", rule_id) return del self.rules[rule_id] self.rule_cnt -= 1
[ "def", "delete_rule", "(", "self", ",", "rule_id", ")", ":", "if", "rule_id", "not", "in", "self", ".", "rules", ":", "LOG", ".", "error", "(", "\"No Rule id present for deleting %s\"", ",", "rule_id", ")", "return", "del", "self", ".", "rules", "[", "rule...
Delete the specific Rule from dictionary indexed by rule id.
[ "Delete", "the", "specific", "Rule", "from", "dictionary", "indexed", "by", "rule", "id", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L124-L130
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.rule_update
def rule_update(self, rule_id, rule): """Update the rule. """ if rule_id not in self.rules: LOG.error("Rule ID not present %s", rule_id) return self.rules[rule_id].update(rule)
python
def rule_update(self, rule_id, rule): """Update the rule. """ if rule_id not in self.rules: LOG.error("Rule ID not present %s", rule_id) return self.rules[rule_id].update(rule)
[ "def", "rule_update", "(", "self", ",", "rule_id", ",", "rule", ")", ":", "if", "rule_id", "not", "in", "self", ".", "rules", ":", "LOG", ".", "error", "(", "\"Rule ID not present %s\"", ",", "rule_id", ")", "return", "self", ".", "rules", "[", "rule_id"...
Update the rule.
[ "Update", "the", "rule", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L142-L147
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.is_fw_present
def is_fw_present(self, fw_id): """Returns if firewall index by ID is present in dictionary. """ if self.fw_id is None or self.fw_id != fw_id: return False else: return True
python
def is_fw_present(self, fw_id): """Returns if firewall index by ID is present in dictionary. """ if self.fw_id is None or self.fw_id != fw_id: return False else: return True
[ "def", "is_fw_present", "(", "self", ",", "fw_id", ")", ":", "if", "self", ".", "fw_id", "is", "None", "or", "self", ".", "fw_id", "!=", "fw_id", ":", "return", "False", "else", ":", "return", "True" ]
Returns if firewall index by ID is present in dictionary.
[ "Returns", "if", "firewall", "index", "by", "ID", "is", "present", "in", "dictionary", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L153-L158
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.create_fw
def create_fw(self, proj_name, pol_id, fw_id, fw_name, fw_type, rtr_id): """Fills up the local attributes when FW is created. """ self.tenant_name = proj_name self.fw_id = fw_id self.fw_name = fw_name self.fw_created = True self.active_pol_id = pol_id self.fw_type...
python
def create_fw(self, proj_name, pol_id, fw_id, fw_name, fw_type, rtr_id): """Fills up the local attributes when FW is created. """ self.tenant_name = proj_name self.fw_id = fw_id self.fw_name = fw_name self.fw_created = True self.active_pol_id = pol_id self.fw_type...
[ "def", "create_fw", "(", "self", ",", "proj_name", ",", "pol_id", ",", "fw_id", ",", "fw_name", ",", "fw_type", ",", "rtr_id", ")", ":", "self", ".", "tenant_name", "=", "proj_name", "self", ".", "fw_id", "=", "fw_id", "self", ".", "fw_name", "=", "fw_...
Fills up the local attributes when FW is created.
[ "Fills", "up", "the", "local", "attributes", "when", "FW", "is", "created", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L160-L168
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.delete_fw
def delete_fw(self, fw_id): """Deletes the FW local attributes. """ self.fw_id = None self.fw_name = None self.fw_created = False self.active_pol_id = None
python
def delete_fw(self, fw_id): """Deletes the FW local attributes. """ self.fw_id = None self.fw_name = None self.fw_created = False self.active_pol_id = None
[ "def", "delete_fw", "(", "self", ",", "fw_id", ")", ":", "self", ".", "fw_id", "=", "None", "self", ".", "fw_name", "=", "None", "self", ".", "fw_created", "=", "False", "self", ".", "active_pol_id", "=", "None" ]
Deletes the FW local attributes.
[ "Deletes", "the", "FW", "local", "attributes", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L170-L175
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.delete_policy
def delete_policy(self, pol_id): """Deletes the policy from the local dictionary. """ if pol_id not in self.policies: LOG.error("Invalid policy %s", pol_id) return del self.policies[pol_id] self.policy_cnt -= 1
python
def delete_policy(self, pol_id): """Deletes the policy from the local dictionary. """ if pol_id not in self.policies: LOG.error("Invalid policy %s", pol_id) return del self.policies[pol_id] self.policy_cnt -= 1
[ "def", "delete_policy", "(", "self", ",", "pol_id", ")", ":", "if", "pol_id", "not", "in", "self", ".", "policies", ":", "LOG", ".", "error", "(", "\"Invalid policy %s\"", ",", "pol_id", ")", "return", "del", "self", ".", "policies", "[", "pol_id", "]", ...
Deletes the policy from the local dictionary.
[ "Deletes", "the", "policy", "from", "the", "local", "dictionary", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L177-L183
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.is_fw_complete
def is_fw_complete(self): """This API returns the completion status of FW. This returns True if a FW is created with a active policy that has more than one rule associated with it and if a driver init is done successfully. """ LOG.info("In fw_complete needed %(fw_created...
python
def is_fw_complete(self): """This API returns the completion status of FW. This returns True if a FW is created with a active policy that has more than one rule associated with it and if a driver init is done successfully. """ LOG.info("In fw_complete needed %(fw_created...
[ "def", "is_fw_complete", "(", "self", ")", ":", "LOG", ".", "info", "(", "\"In fw_complete needed %(fw_created)s \"", "\"%(active_policy_id)s %(is_fw_drvr_created)s \"", "\"%(pol_present)s %(fw_type)s\"", ",", "{", "'fw_created'", ":", "self", ".", "fw_created", ",", "'acti...
This API returns the completion status of FW. This returns True if a FW is created with a active policy that has more than one rule associated with it and if a driver init is done successfully.
[ "This", "API", "returns", "the", "completion", "status", "of", "FW", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L185-L210
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.one_rule_present
def one_rule_present(self, pol_id): """Returns if atleast one rule is present in the policy. """ pol_dict = self.policies[pol_id] for rule in pol_dict['rule_dict']: if self.is_rule_present(rule): return True return False
python
def one_rule_present(self, pol_id): """Returns if atleast one rule is present in the policy. """ pol_dict = self.policies[pol_id] for rule in pol_dict['rule_dict']: if self.is_rule_present(rule): return True return False
[ "def", "one_rule_present", "(", "self", ",", "pol_id", ")", ":", "pol_dict", "=", "self", ".", "policies", "[", "pol_id", "]", "for", "rule", "in", "pol_dict", "[", "'rule_dict'", "]", ":", "if", "self", ".", "is_rule_present", "(", "rule", ")", ":", "...
Returns if atleast one rule is present in the policy.
[ "Returns", "if", "atleast", "one", "rule", "is", "present", "in", "the", "policy", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L240-L246
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.get_fw_dict
def get_fw_dict(self): """This API creates a FW dictionary from the local attributes. """ fw_dict = {} if self.fw_id is None: return fw_dict fw_dict = {'rules': {}, 'tenant_name': self.tenant_name, 'tenant_id': self.tenant_id, 'fw_id': self.fw_id, ...
python
def get_fw_dict(self): """This API creates a FW dictionary from the local attributes. """ fw_dict = {} if self.fw_id is None: return fw_dict fw_dict = {'rules': {}, 'tenant_name': self.tenant_name, 'tenant_id': self.tenant_id, 'fw_id': self.fw_id, ...
[ "def", "get_fw_dict", "(", "self", ")", ":", "fw_dict", "=", "{", "}", "if", "self", ".", "fw_id", "is", "None", ":", "return", "fw_dict", "fw_dict", "=", "{", "'rules'", ":", "{", "}", ",", "'tenant_name'", ":", "self", ".", "tenant_name", ",", "'te...
This API creates a FW dictionary from the local attributes.
[ "This", "API", "creates", "a", "FW", "dictionary", "from", "the", "local", "attributes", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L262-L281
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMapAttr.update_fw_params
def update_fw_params(self, rtr_id=-1, fw_type=-1): """Updates the FW parameters. """ if rtr_id != -1: self.router_id = rtr_id if fw_type != -1: self.fw_type = fw_type
python
def update_fw_params(self, rtr_id=-1, fw_type=-1): """Updates the FW parameters. """ if rtr_id != -1: self.router_id = rtr_id if fw_type != -1: self.fw_type = fw_type
[ "def", "update_fw_params", "(", "self", ",", "rtr_id", "=", "-", "1", ",", "fw_type", "=", "-", "1", ")", ":", "if", "rtr_id", "!=", "-", "1", ":", "self", ".", "router_id", "=", "rtr_id", "if", "fw_type", "!=", "-", "1", ":", "self", ".", "fw_ty...
Updates the FW parameters.
[ "Updates", "the", "FW", "parameters", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L283-L288
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.populate_cfg_dcnm
def populate_cfg_dcnm(self, cfg, dcnm_obj): """This routine stores the DCNM object. """ if not self.fw_init: return self.dcnm_obj = dcnm_obj self.fabric.store_dcnm(dcnm_obj) self.populate_dcnm_obj(dcnm_obj)
python
def populate_cfg_dcnm(self, cfg, dcnm_obj): """This routine stores the DCNM object. """ if not self.fw_init: return self.dcnm_obj = dcnm_obj self.fabric.store_dcnm(dcnm_obj) self.populate_dcnm_obj(dcnm_obj)
[ "def", "populate_cfg_dcnm", "(", "self", ",", "cfg", ",", "dcnm_obj", ")", ":", "if", "not", "self", ".", "fw_init", ":", "return", "self", ".", "dcnm_obj", "=", "dcnm_obj", "self", ".", "fabric", ".", "store_dcnm", "(", "dcnm_obj", ")", "self", ".", "...
This routine stores the DCNM object.
[ "This", "routine", "stores", "the", "DCNM", "object", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L327-L333
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.populate_event_queue
def populate_event_queue(self, cfg, que_obj): """This routine is for storing the Event Queue obj. """ if not self.fw_init: return self.que_obj = que_obj self.populate_event_que(que_obj)
python
def populate_event_queue(self, cfg, que_obj): """This routine is for storing the Event Queue obj. """ if not self.fw_init: return self.que_obj = que_obj self.populate_event_que(que_obj)
[ "def", "populate_event_queue", "(", "self", ",", "cfg", ",", "que_obj", ")", ":", "if", "not", "self", ".", "fw_init", ":", "return", "self", ".", "que_obj", "=", "que_obj", "self", ".", "populate_event_que", "(", "que_obj", ")" ]
This routine is for storing the Event Queue obj.
[ "This", "routine", "is", "for", "storing", "the", "Event", "Queue", "obj", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L335-L340
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.network_sub_create_notif
def network_sub_create_notif(self, tenant_id, tenant_name, cidr): """Network create notification. """ if not self.fw_init: return self.network_create_notif(tenant_id, tenant_name, cidr)
python
def network_sub_create_notif(self, tenant_id, tenant_name, cidr): """Network create notification. """ if not self.fw_init: return self.network_create_notif(tenant_id, tenant_name, cidr)
[ "def", "network_sub_create_notif", "(", "self", ",", "tenant_id", ",", "tenant_name", ",", "cidr", ")", ":", "if", "not", "self", ".", "fw_init", ":", "return", "self", ".", "network_create_notif", "(", "tenant_id", ",", "tenant_name", ",", "cidr", ")" ]
Network create notification.
[ "Network", "create", "notification", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L342-L346
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.network_del_notif
def network_del_notif(self, tenant_id, tenant_name, net_id): """Network delete notification. """ if not self.fw_init: return self.network_delete_notif(tenant_id, tenant_name, net_id)
python
def network_del_notif(self, tenant_id, tenant_name, net_id): """Network delete notification. """ if not self.fw_init: return self.network_delete_notif(tenant_id, tenant_name, net_id)
[ "def", "network_del_notif", "(", "self", ",", "tenant_id", ",", "tenant_name", ",", "net_id", ")", ":", "if", "not", "self", ".", "fw_init", ":", "return", "self", ".", "network_delete_notif", "(", "tenant_id", ",", "tenant_name", ",", "net_id", ")" ]
Network delete notification.
[ "Network", "delete", "notification", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L348-L352
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.project_create_notif
def project_create_notif(self, tenant_id, tenant_name): """Tenant Create notification. """ if not self.fw_init: return self.os_helper.create_router('_'.join([fw_constants.TENANT_EDGE_RTR, tenant_name]), ...
python
def project_create_notif(self, tenant_id, tenant_name): """Tenant Create notification. """ if not self.fw_init: return self.os_helper.create_router('_'.join([fw_constants.TENANT_EDGE_RTR, tenant_name]), ...
[ "def", "project_create_notif", "(", "self", ",", "tenant_id", ",", "tenant_name", ")", ":", "if", "not", "self", ".", "fw_init", ":", "return", "self", ".", "os_helper", ".", "create_router", "(", "'_'", ".", "join", "(", "[", "fw_constants", ".", "TENANT_...
Tenant Create notification.
[ "Tenant", "Create", "notification", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L354-L360
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.project_delete_notif
def project_delete_notif(self, tenant_id, tenant_name): """Tenant Delete notification. """ if not self.fw_init: return rtr_name = '_'.join([fw_constants.TENANT_EDGE_RTR, tenant_name]) self.os_helper.delete_router_by_name(rtr_name, tenant_id)
python
def project_delete_notif(self, tenant_id, tenant_name): """Tenant Delete notification. """ if not self.fw_init: return rtr_name = '_'.join([fw_constants.TENANT_EDGE_RTR, tenant_name]) self.os_helper.delete_router_by_name(rtr_name, tenant_id)
[ "def", "project_delete_notif", "(", "self", ",", "tenant_id", ",", "tenant_name", ")", ":", "if", "not", "self", ".", "fw_init", ":", "return", "rtr_name", "=", "'_'", ".", "join", "(", "[", "fw_constants", ".", "TENANT_EDGE_RTR", ",", "tenant_name", "]", ...
Tenant Delete notification.
[ "Tenant", "Delete", "notification", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L362-L367
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._create_fw_fab_dev_te
def _create_fw_fab_dev_te(self, tenant_id, drvr_name, fw_dict): """Prepares the Fabric and configures the device. This routine calls the fabric class to prepare the fabric when a firewall is created. It also calls the device manager to configure the device. It updates the database with ...
python
def _create_fw_fab_dev_te(self, tenant_id, drvr_name, fw_dict): """Prepares the Fabric and configures the device. This routine calls the fabric class to prepare the fabric when a firewall is created. It also calls the device manager to configure the device. It updates the database with ...
[ "def", "_create_fw_fab_dev_te", "(", "self", ",", "tenant_id", ",", "drvr_name", ",", "fw_dict", ")", ":", "is_fw_virt", "=", "self", ".", "is_device_virtual", "(", ")", "ret", "=", "self", ".", "fabric", ".", "prepare_fabric_fw", "(", "tenant_id", ",", "fw_...
Prepares the Fabric and configures the device. This routine calls the fabric class to prepare the fabric when a firewall is created. It also calls the device manager to configure the device. It updates the database with the final result.
[ "Prepares", "the", "Fabric", "and", "configures", "the", "device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L369-L396
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._create_fw_fab_dev
def _create_fw_fab_dev(self, tenant_id, drvr_name, fw_dict): """This routine calls the Tenant Edge routine if FW Type is TE. """ if fw_dict.get('fw_type') == fw_constants.FW_TENANT_EDGE: self._create_fw_fab_dev_te(tenant_id, drvr_name, fw_dict)
python
def _create_fw_fab_dev(self, tenant_id, drvr_name, fw_dict): """This routine calls the Tenant Edge routine if FW Type is TE. """ if fw_dict.get('fw_type') == fw_constants.FW_TENANT_EDGE: self._create_fw_fab_dev_te(tenant_id, drvr_name, fw_dict)
[ "def", "_create_fw_fab_dev", "(", "self", ",", "tenant_id", ",", "drvr_name", ",", "fw_dict", ")", ":", "if", "fw_dict", ".", "get", "(", "'fw_type'", ")", "==", "fw_constants", ".", "FW_TENANT_EDGE", ":", "self", ".", "_create_fw_fab_dev_te", "(", "tenant_id"...
This routine calls the Tenant Edge routine if FW Type is TE.
[ "This", "routine", "calls", "the", "Tenant", "Edge", "routine", "if", "FW", "Type", "is", "TE", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L398-L401
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._check_create_fw
def _check_create_fw(self, tenant_id, drvr_name): """Creates the Firewall, if all conditions are met. This function first checks if all the configuration are done for a FW to be launched. After that it creates the FW entry in the DB. After that, it calls the routine to prepare the fabri...
python
def _check_create_fw(self, tenant_id, drvr_name): """Creates the Firewall, if all conditions are met. This function first checks if all the configuration are done for a FW to be launched. After that it creates the FW entry in the DB. After that, it calls the routine to prepare the fabri...
[ "def", "_check_create_fw", "(", "self", ",", "tenant_id", ",", "drvr_name", ")", ":", "if", "self", ".", "fwid_attr", "[", "tenant_id", "]", ".", "is_fw_drvr_create_needed", "(", ")", ":", "fw_dict", "=", "self", ".", "fwid_attr", "[", "tenant_id", "]", "....
Creates the Firewall, if all conditions are met. This function first checks if all the configuration are done for a FW to be launched. After that it creates the FW entry in the DB. After that, it calls the routine to prepare the fabric and configure the device.
[ "Creates", "the", "Firewall", "if", "all", "conditions", "are", "met", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L403-L423
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._check_delete_fw
def _check_delete_fw(self, tenant_id, drvr_name): """Deletes the Firewall, if all conditioms are met. This function after modifying the DB with delete operation status, calls the routine to remove the fabric cfg from DB and unconfigure the device. """ fw_dict = self.fwid...
python
def _check_delete_fw(self, tenant_id, drvr_name): """Deletes the Firewall, if all conditioms are met. This function after modifying the DB with delete operation status, calls the routine to remove the fabric cfg from DB and unconfigure the device. """ fw_dict = self.fwid...
[ "def", "_check_delete_fw", "(", "self", ",", "tenant_id", ",", "drvr_name", ")", ":", "fw_dict", "=", "self", ".", "fwid_attr", "[", "tenant_id", "]", ".", "get_fw_dict", "(", ")", "ret", "=", "False", "try", ":", "with", "self", ".", "fwid_attr", "[", ...
Deletes the Firewall, if all conditioms are met. This function after modifying the DB with delete operation status, calls the routine to remove the fabric cfg from DB and unconfigure the device.
[ "Deletes", "the", "Firewall", "if", "all", "conditioms", "are", "met", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L455-L471
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._check_update_fw
def _check_update_fw(self, tenant_id, drvr_name): """Update the Firewall config by calling the driver. This function calls the device manager routine to update the device with modified FW cfg. """ if self.fwid_attr[tenant_id].is_fw_complete(): fw_dict = self.fwid_att...
python
def _check_update_fw(self, tenant_id, drvr_name): """Update the Firewall config by calling the driver. This function calls the device manager routine to update the device with modified FW cfg. """ if self.fwid_attr[tenant_id].is_fw_complete(): fw_dict = self.fwid_att...
[ "def", "_check_update_fw", "(", "self", ",", "tenant_id", ",", "drvr_name", ")", ":", "if", "self", ".", "fwid_attr", "[", "tenant_id", "]", ".", "is_fw_complete", "(", ")", ":", "fw_dict", "=", "self", ".", "fwid_attr", "[", "tenant_id", "]", ".", "get_...
Update the Firewall config by calling the driver. This function calls the device manager routine to update the device with modified FW cfg.
[ "Update", "the", "Firewall", "config", "by", "calling", "the", "driver", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L473-L481
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._fw_create
def _fw_create(self, drvr_name, data, cache): """Firewall create routine. This function updates its local cache with FW parameters. It checks if local cache has information about the Policy associated with the FW. If not, it means a restart has happened. It retrieves the policy ...
python
def _fw_create(self, drvr_name, data, cache): """Firewall create routine. This function updates its local cache with FW parameters. It checks if local cache has information about the Policy associated with the FW. If not, it means a restart has happened. It retrieves the policy ...
[ "def", "_fw_create", "(", "self", ",", "drvr_name", ",", "data", ",", "cache", ")", ":", "fw", "=", "data", ".", "get", "(", "'firewall'", ")", "tenant_id", "=", "fw", ".", "get", "(", "'tenant_id'", ")", "fw_name", "=", "fw", ".", "get", "(", "'na...
Firewall create routine. This function updates its local cache with FW parameters. It checks if local cache has information about the Policy associated with the FW. If not, it means a restart has happened. It retrieves the policy associated with the FW by calling Openstack API's...
[ "Firewall", "create", "routine", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L496-L537
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fw_create
def fw_create(self, data, fw_name=None, cache=False): """Top level FW create function. """ LOG.debug("FW create %s", data) try: self._fw_create(fw_name, data, cache) except Exception as exc: LOG.error("Exception in fw_create %s", str(exc))
python
def fw_create(self, data, fw_name=None, cache=False): """Top level FW create function. """ LOG.debug("FW create %s", data) try: self._fw_create(fw_name, data, cache) except Exception as exc: LOG.error("Exception in fw_create %s", str(exc))
[ "def", "fw_create", "(", "self", ",", "data", ",", "fw_name", "=", "None", ",", "cache", "=", "False", ")", ":", "LOG", ".", "debug", "(", "\"FW create %s\"", ",", "data", ")", "try", ":", "self", ".", "_fw_create", "(", "fw_name", ",", "data", ",", ...
Top level FW create function.
[ "Top", "level", "FW", "create", "function", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L539-L545
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._fw_update
def _fw_update(self, drvr_name, data): """Update routine for the Firewall. Check if FW is already cfgd using the below function if self.fwid_attr[tenant_id].is_fw_complete() or is_fw_drvr_create_needed(): The above two functions will take care of whether FW is already cf...
python
def _fw_update(self, drvr_name, data): """Update routine for the Firewall. Check if FW is already cfgd using the below function if self.fwid_attr[tenant_id].is_fw_complete() or is_fw_drvr_create_needed(): The above two functions will take care of whether FW is already cf...
[ "def", "_fw_update", "(", "self", ",", "drvr_name", ",", "data", ")", ":", "fw", "=", "data", ".", "get", "(", "'firewall'", ")", "tenant_id", "=", "fw", ".", "get", "(", "'tenant_id'", ")", "if", "self", ".", "fwid_attr", "[", "tenant_id", "]", ".",...
Update routine for the Firewall. Check if FW is already cfgd using the below function if self.fwid_attr[tenant_id].is_fw_complete() or is_fw_drvr_create_needed(): The above two functions will take care of whether FW is already cfgd or about to be cfgd in case of error. I...
[ "Update", "routine", "for", "the", "Firewall", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L548-L581
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fw_update
def fw_update(self, data, fw_name=None): """Top level FW update function. """ LOG.debug("FW Update %s", data) self._fw_update(fw_name, data)
python
def fw_update(self, data, fw_name=None): """Top level FW update function. """ LOG.debug("FW Update %s", data) self._fw_update(fw_name, data)
[ "def", "fw_update", "(", "self", ",", "data", ",", "fw_name", "=", "None", ")", ":", "LOG", ".", "debug", "(", "\"FW Update %s\"", ",", "data", ")", "self", ".", "_fw_update", "(", "fw_name", ",", "data", ")" ]
Top level FW update function.
[ "Top", "level", "FW", "update", "function", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L583-L586
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._fw_delete
def _fw_delete(self, drvr_name, data): """Firewall Delete routine. This function calls routines to remove FW from fabric and device. It also updates its local cache. """ fw_id = data.get('firewall_id') tenant_id = self.tenant_db.get_fw_tenant(fw_id) if tenant_id...
python
def _fw_delete(self, drvr_name, data): """Firewall Delete routine. This function calls routines to remove FW from fabric and device. It also updates its local cache. """ fw_id = data.get('firewall_id') tenant_id = self.tenant_db.get_fw_tenant(fw_id) if tenant_id...
[ "def", "_fw_delete", "(", "self", ",", "drvr_name", ",", "data", ")", ":", "fw_id", "=", "data", ".", "get", "(", "'firewall_id'", ")", "tenant_id", "=", "self", ".", "tenant_db", ".", "get_fw_tenant", "(", "fw_id", ")", "if", "tenant_id", "not", "in", ...
Firewall Delete routine. This function calls routines to remove FW from fabric and device. It also updates its local cache.
[ "Firewall", "Delete", "routine", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L589-L606
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._fw_rule_decode_store
def _fw_rule_decode_store(self, data): """Misc function to decode the firewall rule from Openstack. """ fw_rule = data.get('firewall_rule') rule = {'protocol': fw_rule.get('protocol'), 'source_ip_address': fw_rule.get('source_ip_address'), 'destination_ip_address'...
python
def _fw_rule_decode_store(self, data): """Misc function to decode the firewall rule from Openstack. """ fw_rule = data.get('firewall_rule') rule = {'protocol': fw_rule.get('protocol'), 'source_ip_address': fw_rule.get('source_ip_address'), 'destination_ip_address'...
[ "def", "_fw_rule_decode_store", "(", "self", ",", "data", ")", ":", "fw_rule", "=", "data", ".", "get", "(", "'firewall_rule'", ")", "rule", "=", "{", "'protocol'", ":", "fw_rule", ".", "get", "(", "'protocol'", ")", ",", "'source_ip_address'", ":", "fw_ru...
Misc function to decode the firewall rule from Openstack.
[ "Misc", "function", "to", "decode", "the", "firewall", "rule", "from", "Openstack", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L612-L624
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._fw_rule_create
def _fw_rule_create(self, drvr_name, data, cache): """Firewall Rule create routine. This function updates its local cache with rule parameters. It checks if local cache has information about the Policy associated with the rule. If not, it means a restart has happened. It retriev...
python
def _fw_rule_create(self, drvr_name, data, cache): """Firewall Rule create routine. This function updates its local cache with rule parameters. It checks if local cache has information about the Policy associated with the rule. If not, it means a restart has happened. It retriev...
[ "def", "_fw_rule_create", "(", "self", ",", "drvr_name", ",", "data", ",", "cache", ")", ":", "tenant_id", "=", "data", ".", "get", "(", "'firewall_rule'", ")", ".", "get", "(", "'tenant_id'", ")", "fw_rule", "=", "data", ".", "get", "(", "'firewall_rule...
Firewall Rule create routine. This function updates its local cache with rule parameters. It checks if local cache has information about the Policy associated with the rule. If not, it means a restart has happened. It retrieves the policy associated with the FW by calling Openst...
[ "Firewall", "Rule", "create", "routine", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L627-L651
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fw_rule_create
def fw_rule_create(self, data, fw_name=None, cache=False): """Top level rule creation routine. """ LOG.debug("FW Rule create %s", data) self._fw_rule_create(fw_name, data, cache)
python
def fw_rule_create(self, data, fw_name=None, cache=False): """Top level rule creation routine. """ LOG.debug("FW Rule create %s", data) self._fw_rule_create(fw_name, data, cache)
[ "def", "fw_rule_create", "(", "self", ",", "data", ",", "fw_name", "=", "None", ",", "cache", "=", "False", ")", ":", "LOG", ".", "debug", "(", "\"FW Rule create %s\"", ",", "data", ")", "self", ".", "_fw_rule_create", "(", "fw_name", ",", "data", ",", ...
Top level rule creation routine.
[ "Top", "level", "rule", "creation", "routine", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L653-L656
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._fw_rule_delete
def _fw_rule_delete(self, drvr_name, data): """Function that updates its local cache after a rule is deleted. """ rule_id = data.get('firewall_rule_id') tenant_id = self.tenant_db.get_rule_tenant(rule_id) if tenant_id not in self.fwid_attr: LOG.error("Invalid tenant id for F...
python
def _fw_rule_delete(self, drvr_name, data): """Function that updates its local cache after a rule is deleted. """ rule_id = data.get('firewall_rule_id') tenant_id = self.tenant_db.get_rule_tenant(rule_id) if tenant_id not in self.fwid_attr: LOG.error("Invalid tenant id for F...
[ "def", "_fw_rule_delete", "(", "self", ",", "drvr_name", ",", "data", ")", ":", "rule_id", "=", "data", ".", "get", "(", "'firewall_rule_id'", ")", "tenant_id", "=", "self", ".", "tenant_db", ".", "get_rule_tenant", "(", "rule_id", ")", "if", "tenant_id", ...
Function that updates its local cache after a rule is deleted.
[ "Function", "that", "updates", "its", "local", "cache", "after", "a", "rule", "is", "deleted", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L659-L671
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fw_rule_delete
def fw_rule_delete(self, data, fw_name=None): """Top level rule delete function. """ LOG.debug("FW Rule delete %s", data) self._fw_rule_delete(fw_name, data)
python
def fw_rule_delete(self, data, fw_name=None): """Top level rule delete function. """ LOG.debug("FW Rule delete %s", data) self._fw_rule_delete(fw_name, data)
[ "def", "fw_rule_delete", "(", "self", ",", "data", ",", "fw_name", "=", "None", ")", ":", "LOG", ".", "debug", "(", "\"FW Rule delete %s\"", ",", "data", ")", "self", ".", "_fw_rule_delete", "(", "fw_name", ",", "data", ")" ]
Top level rule delete function.
[ "Top", "level", "rule", "delete", "function", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L673-L676
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._fw_rule_update
def _fw_rule_update(self, drvr_name, data): """Firewall Rule update routine. Function to decode the updated rules and call routines that in turn calls the device routines to update rules. """ LOG.debug("FW Update %s", data) tenant_id = data.get('firewall_rule').get('tena...
python
def _fw_rule_update(self, drvr_name, data): """Firewall Rule update routine. Function to decode the updated rules and call routines that in turn calls the device routines to update rules. """ LOG.debug("FW Update %s", data) tenant_id = data.get('firewall_rule').get('tena...
[ "def", "_fw_rule_update", "(", "self", ",", "drvr_name", ",", "data", ")", ":", "LOG", ".", "debug", "(", "\"FW Update %s\"", ",", "data", ")", "tenant_id", "=", "data", ".", "get", "(", "'firewall_rule'", ")", ".", "get", "(", "'tenant_id'", ")", "fw_ru...
Firewall Rule update routine. Function to decode the updated rules and call routines that in turn calls the device routines to update rules.
[ "Firewall", "Rule", "update", "routine", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L679-L695
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fw_rule_update
def fw_rule_update(self, data, fw_name=None): """Top level rule update routine. """ LOG.debug("FW Update Debug") self._fw_rule_update(fw_name, data)
python
def fw_rule_update(self, data, fw_name=None): """Top level rule update routine. """ LOG.debug("FW Update Debug") self._fw_rule_update(fw_name, data)
[ "def", "fw_rule_update", "(", "self", ",", "data", ",", "fw_name", "=", "None", ")", ":", "LOG", ".", "debug", "(", "\"FW Update Debug\"", ")", "self", ".", "_fw_rule_update", "(", "fw_name", ",", "data", ")" ]
Top level rule update routine.
[ "Top", "level", "rule", "update", "routine", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L697-L700
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._fw_policy_delete
def _fw_policy_delete(self, drvr_name, data): """Routine to delete the policy from local cache. """ policy_id = data.get('firewall_policy_id') tenant_id = self.tenant_db.get_policy_tenant(policy_id) if tenant_id not in self.fwid_attr: LOG.error("Invalid tenant id for FW dele...
python
def _fw_policy_delete(self, drvr_name, data): """Routine to delete the policy from local cache. """ policy_id = data.get('firewall_policy_id') tenant_id = self.tenant_db.get_policy_tenant(policy_id) if tenant_id not in self.fwid_attr: LOG.error("Invalid tenant id for FW dele...
[ "def", "_fw_policy_delete", "(", "self", ",", "drvr_name", ",", "data", ")", ":", "policy_id", "=", "data", ".", "get", "(", "'firewall_policy_id'", ")", "tenant_id", "=", "self", ".", "tenant_db", ".", "get_policy_tenant", "(", "policy_id", ")", "if", "tena...
Routine to delete the policy from local cache.
[ "Routine", "to", "delete", "the", "policy", "from", "local", "cache", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L703-L715
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fw_policy_delete
def fw_policy_delete(self, data, fw_name=None): """Top level policy delete routine. """ LOG.debug("FW Policy Debug") self._fw_policy_delete(fw_name, data)
python
def fw_policy_delete(self, data, fw_name=None): """Top level policy delete routine. """ LOG.debug("FW Policy Debug") self._fw_policy_delete(fw_name, data)
[ "def", "fw_policy_delete", "(", "self", ",", "data", ",", "fw_name", "=", "None", ")", ":", "LOG", ".", "debug", "(", "\"FW Policy Debug\"", ")", "self", ".", "_fw_policy_delete", "(", "fw_name", ",", "data", ")" ]
Top level policy delete routine.
[ "Top", "level", "policy", "delete", "routine", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L717-L720
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._fw_policy_create
def _fw_policy_create(self, drvr_name, data, cache): """Firewall Policy create routine. This function updates its local cache with policy parameters. It checks if local cache has information about the rules associated with the policy. If not, it means a restart has happened. It ...
python
def _fw_policy_create(self, drvr_name, data, cache): """Firewall Policy create routine. This function updates its local cache with policy parameters. It checks if local cache has information about the rules associated with the policy. If not, it means a restart has happened. It ...
[ "def", "_fw_policy_create", "(", "self", ",", "drvr_name", ",", "data", ",", "cache", ")", ":", "policy", "=", "{", "}", "fw_policy", "=", "data", ".", "get", "(", "'firewall_policy'", ")", "tenant_id", "=", "fw_policy", ".", "get", "(", "'tenant_id'", "...
Firewall Policy create routine. This function updates its local cache with policy parameters. It checks if local cache has information about the rules associated with the policy. If not, it means a restart has happened. It retrieves the rules associated with the policy by callin...
[ "Firewall", "Policy", "create", "routine", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L723-L752
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fw_policy_create
def fw_policy_create(self, data, fw_name=None, cache=False): """Top level policy create routine. """ LOG.debug("FW Policy Debug") self._fw_policy_create(fw_name, data, cache)
python
def fw_policy_create(self, data, fw_name=None, cache=False): """Top level policy create routine. """ LOG.debug("FW Policy Debug") self._fw_policy_create(fw_name, data, cache)
[ "def", "fw_policy_create", "(", "self", ",", "data", ",", "fw_name", "=", "None", ",", "cache", "=", "False", ")", ":", "LOG", ".", "debug", "(", "\"FW Policy Debug\"", ")", "self", ".", "_fw_policy_create", "(", "fw_name", ",", "data", ",", "cache", ")"...
Top level policy create routine.
[ "Top", "level", "policy", "create", "routine", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L754-L757
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.convert_fwdb_event_msg
def convert_fwdb_event_msg(self, rule, tenant_id, rule_id, policy_id): """Convert the Firewall DB to a event message format. From inputs from DB, this will create a FW rule dictionary that resembles the actual data from Openstack when a rule is created. This is usually called after rest...
python
def convert_fwdb_event_msg(self, rule, tenant_id, rule_id, policy_id): """Convert the Firewall DB to a event message format. From inputs from DB, this will create a FW rule dictionary that resembles the actual data from Openstack when a rule is created. This is usually called after rest...
[ "def", "convert_fwdb_event_msg", "(", "self", ",", "rule", ",", "tenant_id", ",", "rule_id", ",", "policy_id", ")", ":", "rule", ".", "update", "(", "{", "'tenant_id'", ":", "tenant_id", ",", "'id'", ":", "rule_id", ",", "'firewall_policy_id'", ":", "policy_...
Convert the Firewall DB to a event message format. From inputs from DB, this will create a FW rule dictionary that resembles the actual data from Openstack when a rule is created. This is usually called after restart, in order to populate local cache.
[ "Convert", "the", "Firewall", "DB", "to", "a", "event", "message", "format", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L759-L770
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.convert_fwdb
def convert_fwdb(self, tenant_id, name, policy_id, fw_id): """Convert the Firewall DB to a query response. From FWDB inputs, this will create a FW message that resembles the actual data from Openstack, when a query for FW is done. """ fw_dict = {'tenant_id': tenant_id, 'name': n...
python
def convert_fwdb(self, tenant_id, name, policy_id, fw_id): """Convert the Firewall DB to a query response. From FWDB inputs, this will create a FW message that resembles the actual data from Openstack, when a query for FW is done. """ fw_dict = {'tenant_id': tenant_id, 'name': n...
[ "def", "convert_fwdb", "(", "self", ",", "tenant_id", ",", "name", ",", "policy_id", ",", "fw_id", ")", ":", "fw_dict", "=", "{", "'tenant_id'", ":", "tenant_id", ",", "'name'", ":", "name", ",", "'id'", ":", "fw_id", ",", "'firewall_policy_id'", ":", "p...
Convert the Firewall DB to a query response. From FWDB inputs, this will create a FW message that resembles the actual data from Openstack, when a query for FW is done.
[ "Convert", "the", "Firewall", "DB", "to", "a", "query", "response", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L772-L782
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.populate_local_cache
def populate_local_cache(self): """This populates the local cache after reading the Database. It calls the appropriate rule create, fw create routines. It doesn't actually call the routine to prepare the fabric or cfg the device since it will be handled by retry module. """ ...
python
def populate_local_cache(self): """This populates the local cache after reading the Database. It calls the appropriate rule create, fw create routines. It doesn't actually call the routine to prepare the fabric or cfg the device since it will be handled by retry module. """ ...
[ "def", "populate_local_cache", "(", "self", ")", ":", "fw_dict", "=", "self", ".", "get_all_fw_db", "(", ")", "LOG", ".", "info", "(", "\"Populating FW Mgr Local Cache\"", ")", "for", "fw_id", "in", "fw_dict", ":", "fw_data", "=", "fw_dict", ".", "get", "(",...
This populates the local cache after reading the Database. It calls the appropriate rule create, fw create routines. It doesn't actually call the routine to prepare the fabric or cfg the device since it will be handled by retry module.
[ "This", "populates", "the", "local", "cache", "after", "reading", "the", "Database", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L784-L816
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.retry_failure_fab_dev_create
def retry_failure_fab_dev_create(self, tenant_id, fw_data, fw_dict): """This module calls routine in fabric to retry the failure cases. If device is not successfully cfg/uncfg, it calls the device manager routine to cfg/uncfg the device. """ result = fw_data.get('result').split(...
python
def retry_failure_fab_dev_create(self, tenant_id, fw_data, fw_dict): """This module calls routine in fabric to retry the failure cases. If device is not successfully cfg/uncfg, it calls the device manager routine to cfg/uncfg the device. """ result = fw_data.get('result').split(...
[ "def", "retry_failure_fab_dev_create", "(", "self", ",", "tenant_id", ",", "fw_data", ",", "fw_dict", ")", ":", "result", "=", "fw_data", ".", "get", "(", "'result'", ")", ".", "split", "(", "'('", ")", "[", "0", "]", "is_fw_virt", "=", "self", ".", "i...
This module calls routine in fabric to retry the failure cases. If device is not successfully cfg/uncfg, it calls the device manager routine to cfg/uncfg the device.
[ "This", "module", "calls", "routine", "in", "fabric", "to", "retry", "the", "failure", "cases", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L818-L848
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.retry_failure_fab_dev_delete
def retry_failure_fab_dev_delete(self, tenant_id, fw_data, fw_dict): """Retry the failure cases for delete. This module calls routine in fabric to retry the failure cases for delete. If device is not successfully cfg/uncfg, it calls the device manager routine to cfg/uncfg the de...
python
def retry_failure_fab_dev_delete(self, tenant_id, fw_data, fw_dict): """Retry the failure cases for delete. This module calls routine in fabric to retry the failure cases for delete. If device is not successfully cfg/uncfg, it calls the device manager routine to cfg/uncfg the de...
[ "def", "retry_failure_fab_dev_delete", "(", "self", ",", "tenant_id", ",", "fw_data", ",", "fw_dict", ")", ":", "result", "=", "fw_data", ".", "get", "(", "'result'", ")", ".", "split", "(", "'('", ")", "[", "0", "]", "name", "=", "dfa_dbm", ".", "DfaD...
Retry the failure cases for delete. This module calls routine in fabric to retry the failure cases for delete. If device is not successfully cfg/uncfg, it calls the device manager routine to cfg/uncfg the device.
[ "Retry", "the", "failure", "cases", "for", "delete", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L850-L886
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fw_retry_failures_create
def fw_retry_failures_create(self): """This module is called for retrying the create cases. """ for tenant_id in self.fwid_attr: try: with self.fwid_attr[tenant_id].mutex_lock: if self.fwid_attr[tenant_id].is_fw_drvr_create_needed(): ...
python
def fw_retry_failures_create(self): """This module is called for retrying the create cases. """ for tenant_id in self.fwid_attr: try: with self.fwid_attr[tenant_id].mutex_lock: if self.fwid_attr[tenant_id].is_fw_drvr_create_needed(): ...
[ "def", "fw_retry_failures_create", "(", "self", ")", ":", "for", "tenant_id", "in", "self", ".", "fwid_attr", ":", "try", ":", "with", "self", ".", "fwid_attr", "[", "tenant_id", "]", ".", "mutex_lock", ":", "if", "self", ".", "fwid_attr", "[", "tenant_id"...
This module is called for retrying the create cases.
[ "This", "module", "is", "called", "for", "retrying", "the", "create", "cases", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L888-L905
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fill_fw_dict_from_db
def fill_fw_dict_from_db(self, fw_data): """ This routine is called to create a local fw_dict with data from DB. """ rule_dict = fw_data.get('rules').get('rules') fw_dict = {'fw_id': fw_data.get('fw_id'), 'fw_name': fw_data.get('name'), 'fire...
python
def fill_fw_dict_from_db(self, fw_data): """ This routine is called to create a local fw_dict with data from DB. """ rule_dict = fw_data.get('rules').get('rules') fw_dict = {'fw_id': fw_data.get('fw_id'), 'fw_name': fw_data.get('name'), 'fire...
[ "def", "fill_fw_dict_from_db", "(", "self", ",", "fw_data", ")", ":", "rule_dict", "=", "fw_data", ".", "get", "(", "'rules'", ")", ".", "get", "(", "'rules'", ")", "fw_dict", "=", "{", "'fw_id'", ":", "fw_data", ".", "get", "(", "'fw_id'", ")", ",", ...
This routine is called to create a local fw_dict with data from DB.
[ "This", "routine", "is", "called", "to", "create", "a", "local", "fw_dict", "with", "data", "from", "DB", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L907-L919
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fw_retry_failures_delete
def fw_retry_failures_delete(self): """This routine is called for retrying the delete cases. """ for tenant_id in self.fwid_attr: try: with self.fwid_attr[tenant_id].mutex_lock: # For both create and delete case fw_data = self.get_fw_by...
python
def fw_retry_failures_delete(self): """This routine is called for retrying the delete cases. """ for tenant_id in self.fwid_attr: try: with self.fwid_attr[tenant_id].mutex_lock: # For both create and delete case fw_data = self.get_fw_by...
[ "def", "fw_retry_failures_delete", "(", "self", ")", ":", "for", "tenant_id", "in", "self", ".", "fwid_attr", ":", "try", ":", "with", "self", ".", "fwid_attr", "[", "tenant_id", "]", ".", "mutex_lock", ":", "fw_data", "=", "self", ".", "get_fw_by_tenant_id"...
This routine is called for retrying the delete cases.
[ "This", "routine", "is", "called", "for", "retrying", "the", "delete", "cases", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L921-L943
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr.fw_retry_failures
def fw_retry_failures(self): """Top level retry routine called. """ if not self.fw_init: return try: self.fw_retry_failures_create() self.fw_retry_failures_delete() except Exception as exc: LOG.error("Exception in retry failures %s", str(ex...
python
def fw_retry_failures(self): """Top level retry routine called. """ if not self.fw_init: return try: self.fw_retry_failures_create() self.fw_retry_failures_delete() except Exception as exc: LOG.error("Exception in retry failures %s", str(ex...
[ "def", "fw_retry_failures", "(", "self", ")", ":", "if", "not", "self", ".", "fw_init", ":", "return", "try", ":", "self", ".", "fw_retry_failures_create", "(", ")", "self", ".", "fw_retry_failures_delete", "(", ")", "except", "Exception", "as", "exc", ":", ...
Top level retry routine called.
[ "Top", "level", "retry", "routine", "called", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L945-L953
train
openstack/networking-cisco
networking_cisco/plugins/cisco/common/htparser.py
HTParser._find_starts
def _find_starts(self, linespec): """ Finds the start points. Start points matching the linespec regex are returned as list in the following format: [(item, index), (item, index)..... """ linespec += ".*" start_points = [] for item in self._inden...
python
def _find_starts(self, linespec): """ Finds the start points. Start points matching the linespec regex are returned as list in the following format: [(item, index), (item, index)..... """ linespec += ".*" start_points = [] for item in self._inden...
[ "def", "_find_starts", "(", "self", ",", "linespec", ")", ":", "linespec", "+=", "\".*\"", "start_points", "=", "[", "]", "for", "item", "in", "self", ".", "_indent_list", ":", "match", "=", "re", ".", "search", "(", "linespec", ",", "item", "[", "1", ...
Finds the start points. Start points matching the linespec regex are returned as list in the following format: [(item, index), (item, index).....
[ "Finds", "the", "start", "points", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/common/htparser.py#L80-L95
train
openstack/networking-cisco
networking_cisco/plugins/cisco/common/htparser.py
HTParser.find_children
def find_children(self, linespec): """Find lines and immediate children that match the linespec regex. :param linespec: regular expression of line to match :returns: list of lines. These correspond to the lines that were matched and their immediate children """ res =...
python
def find_children(self, linespec): """Find lines and immediate children that match the linespec regex. :param linespec: regular expression of line to match :returns: list of lines. These correspond to the lines that were matched and their immediate children """ res =...
[ "def", "find_children", "(", "self", ",", "linespec", ")", ":", "res", "=", "[", "]", "for", "parent", "in", "self", ".", "find_objects", "(", "linespec", ")", ":", "res", ".", "append", "(", "parent", ".", "line", ")", "res", ".", "extend", "(", "...
Find lines and immediate children that match the linespec regex. :param linespec: regular expression of line to match :returns: list of lines. These correspond to the lines that were matched and their immediate children
[ "Find", "lines", "and", "immediate", "children", "that", "match", "the", "linespec", "regex", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/common/htparser.py#L144-L155
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.enable_evb
def enable_evb(self): """Function to enable EVB on the interface. """ if self.is_ncb: self.run_lldptool(["-T", "-i", self.port_name, "-g", "ncb", "-V", "evb", "enableTx=yes"]) ret = self.enable_gpid() return ret else: ...
python
def enable_evb(self): """Function to enable EVB on the interface. """ if self.is_ncb: self.run_lldptool(["-T", "-i", self.port_name, "-g", "ncb", "-V", "evb", "enableTx=yes"]) ret = self.enable_gpid() return ret else: ...
[ "def", "enable_evb", "(", "self", ")", ":", "if", "self", ".", "is_ncb", ":", "self", ".", "run_lldptool", "(", "[", "\"-T\"", ",", "\"-i\"", ",", "self", ".", "port_name", ",", "\"-g\"", ",", "\"ncb\"", ",", "\"-V\"", ",", "\"evb\"", ",", "\"enableTx=...
Function to enable EVB on the interface.
[ "Function", "to", "enable", "EVB", "on", "the", "interface", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L115-L124
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.enable_gpid
def enable_gpid(self): """Function to enable Group ID on the interface. This is needed to use the MAC, GID, VID Filter. """ if self.is_ncb: self.run_lldptool(["-T", "-i", self.port_name, "-g", "ncb", "-V", "evb", "-c", "evbgpid=yes"]) ...
python
def enable_gpid(self): """Function to enable Group ID on the interface. This is needed to use the MAC, GID, VID Filter. """ if self.is_ncb: self.run_lldptool(["-T", "-i", self.port_name, "-g", "ncb", "-V", "evb", "-c", "evbgpid=yes"]) ...
[ "def", "enable_gpid", "(", "self", ")", ":", "if", "self", ".", "is_ncb", ":", "self", ".", "run_lldptool", "(", "[", "\"-T\"", ",", "\"-i\"", ",", "self", ".", "port_name", ",", "\"-g\"", ",", "\"ncb\"", ",", "\"-V\"", ",", "\"evb\"", ",", "\"-c\"", ...
Function to enable Group ID on the interface. This is needed to use the MAC, GID, VID Filter.
[ "Function", "to", "enable", "Group", "ID", "on", "the", "interface", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L126-L137
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver._vdp_refrsh_hndlr
def _vdp_refrsh_hndlr(self): """Periodic refresh of vNIC events to VDP. VDP daemon itself has keepalives. This is needed on top of it to keep Orchestrator like OpenStack, VDP daemon and the physical switch in sync. """ LOG.debug("Refresh handler") try: ...
python
def _vdp_refrsh_hndlr(self): """Periodic refresh of vNIC events to VDP. VDP daemon itself has keepalives. This is needed on top of it to keep Orchestrator like OpenStack, VDP daemon and the physical switch in sync. """ LOG.debug("Refresh handler") try: ...
[ "def", "_vdp_refrsh_hndlr", "(", "self", ")", ":", "LOG", ".", "debug", "(", "\"Refresh handler\"", ")", "try", ":", "if", "not", "self", ".", "vdp_vif_map", ":", "LOG", ".", "debug", "(", "\"vdp_vif_map not created, returning\"", ")", "return", "vdp_vif_map", ...
Periodic refresh of vNIC events to VDP. VDP daemon itself has keepalives. This is needed on top of it to keep Orchestrator like OpenStack, VDP daemon and the physical switch in sync.
[ "Periodic", "refresh", "of", "vNIC", "events", "to", "VDP", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L140-L204
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.store_oui
def store_oui(self, port_uuid, oui_type, oui_data): """Function for storing the OUI. param uuid: UUID of the vNIC param oui_type: OUI ID param oui_data: OUI Opaque Data """ self.oui_vif_map[port_uuid] = {'oui_id': oui_type, 'oui_dat...
python
def store_oui(self, port_uuid, oui_type, oui_data): """Function for storing the OUI. param uuid: UUID of the vNIC param oui_type: OUI ID param oui_data: OUI Opaque Data """ self.oui_vif_map[port_uuid] = {'oui_id': oui_type, 'oui_dat...
[ "def", "store_oui", "(", "self", ",", "port_uuid", ",", "oui_type", ",", "oui_data", ")", ":", "self", ".", "oui_vif_map", "[", "port_uuid", "]", "=", "{", "'oui_id'", ":", "oui_type", ",", "'oui_data'", ":", "oui_data", "}" ]
Function for storing the OUI. param uuid: UUID of the vNIC param oui_type: OUI ID param oui_data: OUI Opaque Data
[ "Function", "for", "storing", "the", "OUI", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L216-L224
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.clear_oui
def clear_oui(self, port_uuid): """Clears the OUI specific info. :param uuid: vNIC UUID Currently only one OUI per VSI fixme(padkrish) """ if port_uuid in self.oui_vif_map: del self.oui_vif_map[port_uuid] else: LOG.debug("OUI does not exist")
python
def clear_oui(self, port_uuid): """Clears the OUI specific info. :param uuid: vNIC UUID Currently only one OUI per VSI fixme(padkrish) """ if port_uuid in self.oui_vif_map: del self.oui_vif_map[port_uuid] else: LOG.debug("OUI does not exist")
[ "def", "clear_oui", "(", "self", ",", "port_uuid", ")", ":", "if", "port_uuid", "in", "self", ".", "oui_vif_map", ":", "del", "self", ".", "oui_vif_map", "[", "port_uuid", "]", "else", ":", "LOG", ".", "debug", "(", "\"OUI does not exist\"", ")" ]
Clears the OUI specific info. :param uuid: vNIC UUID Currently only one OUI per VSI fixme(padkrish)
[ "Clears", "the", "OUI", "specific", "info", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L276-L286
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.gen_cisco_vdp_oui
def gen_cisco_vdp_oui(self, oui_id, oui_data): """Cisco specific handler for constructing OUI arguments. """ oui_list = [] vm_name = oui_data.get('vm_name') if vm_name is not None: oui_str = "oui=%s," % oui_id oui_name_str = oui_str + "vm_name=" + vm_name ...
python
def gen_cisco_vdp_oui(self, oui_id, oui_data): """Cisco specific handler for constructing OUI arguments. """ oui_list = [] vm_name = oui_data.get('vm_name') if vm_name is not None: oui_str = "oui=%s," % oui_id oui_name_str = oui_str + "vm_name=" + vm_name ...
[ "def", "gen_cisco_vdp_oui", "(", "self", ",", "oui_id", ",", "oui_data", ")", ":", "oui_list", "=", "[", "]", "vm_name", "=", "oui_data", ".", "get", "(", "'vm_name'", ")", "if", "vm_name", "is", "not", "None", ":", "oui_str", "=", "\"oui=%s,\"", "%", ...
Cisco specific handler for constructing OUI arguments.
[ "Cisco", "specific", "handler", "for", "constructing", "OUI", "arguments", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L302-L320
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.gen_oui_str
def gen_oui_str(self, oui_list): """Generate the OUI string for vdptool. """ oui_str = [] for oui in oui_list: oui_str.append('-c') oui_str.append(oui) return oui_str
python
def gen_oui_str(self, oui_list): """Generate the OUI string for vdptool. """ oui_str = [] for oui in oui_list: oui_str.append('-c') oui_str.append(oui) return oui_str
[ "def", "gen_oui_str", "(", "self", ",", "oui_list", ")", ":", "oui_str", "=", "[", "]", "for", "oui", "in", "oui_list", ":", "oui_str", ".", "append", "(", "'-c'", ")", "oui_str", ".", "append", "(", "oui", ")", "return", "oui_str" ]
Generate the OUI string for vdptool.
[ "Generate", "the", "OUI", "string", "for", "vdptool", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L322-L328
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.construct_vdp_dict
def construct_vdp_dict(self, mode, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, oui_id, oui_data): """Constructs the VDP Message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more det...
python
def construct_vdp_dict(self, mode, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, oui_id, oui_data): """Constructs the VDP Message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more det...
[ "def", "construct_vdp_dict", "(", "self", ",", "mode", ",", "mgrid", ",", "typeid", ",", "typeid_ver", ",", "vsiid_frmt", ",", "vsiid", ",", "filter_frmt", ",", "gid", ",", "mac", ",", "vlan", ",", "oui_id", ",", "oui_data", ")", ":", "vdp_keyword_str", ...
Constructs the VDP Message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param mode: Associate or De-associate :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID :param vsii...
[ "Constructs", "the", "VDP", "Message", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L330-L402
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.send_vdp_query_msg
def send_vdp_query_msg(self, mode, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, oui_id, oui_data): """Constructs and Sends the VDP Query Message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Sect...
python
def send_vdp_query_msg(self, mode, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, oui_id, oui_data): """Constructs and Sends the VDP Query Message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Sect...
[ "def", "send_vdp_query_msg", "(", "self", ",", "mode", ",", "mgrid", ",", "typeid", ",", "typeid_ver", ",", "vsiid_frmt", ",", "vsiid", ",", "filter_frmt", ",", "gid", ",", "mac", ",", "vlan", ",", "oui_id", ",", "oui_data", ")", ":", "if", "not", "sel...
Constructs and Sends the VDP Query Message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param mode: Associate or De-associate :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID ...
[ "Constructs", "and", "Sends", "the", "VDP", "Query", "Message", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L404-L442
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.send_vdp_msg
def send_vdp_msg(self, mode, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, oui_id, oui_data, sw_resp): """Constructs and Sends the VDP Message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more de...
python
def send_vdp_msg(self, mode, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, oui_id, oui_data, sw_resp): """Constructs and Sends the VDP Message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more de...
[ "def", "send_vdp_msg", "(", "self", ",", "mode", ",", "mgrid", ",", "typeid", ",", "typeid_ver", ",", "vsiid_frmt", ",", "vsiid", ",", "filter_frmt", ",", "gid", ",", "mac", ",", "vlan", ",", "oui_id", ",", "oui_data", ",", "sw_resp", ")", ":", "if", ...
Constructs and Sends the VDP Message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param mode: Associate or De-associate :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID :...
[ "Constructs", "and", "Sends", "the", "VDP", "Message", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L444-L502
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.crosscheck_query_vsiid_mac
def crosscheck_query_vsiid_mac(self, reply, vsiid, mac): """Cross Check the reply against the input vsiid,mac for get query. """ vsiid_reply = reply.partition("uuid")[2].split()[0][4:] if vsiid != vsiid_reply: fail_reason = vdp_const.vsi_mismatch_failure_reason % ( vs...
python
def crosscheck_query_vsiid_mac(self, reply, vsiid, mac): """Cross Check the reply against the input vsiid,mac for get query. """ vsiid_reply = reply.partition("uuid")[2].split()[0][4:] if vsiid != vsiid_reply: fail_reason = vdp_const.vsi_mismatch_failure_reason % ( vs...
[ "def", "crosscheck_query_vsiid_mac", "(", "self", ",", "reply", ",", "vsiid", ",", "mac", ")", ":", "vsiid_reply", "=", "reply", ".", "partition", "(", "\"uuid\"", ")", "[", "2", "]", ".", "split", "(", ")", "[", "0", "]", "[", "4", ":", "]", "if",...
Cross Check the reply against the input vsiid,mac for get query.
[ "Cross", "Check", "the", "reply", "against", "the", "input", "vsiid", "mac", "for", "get", "query", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L520-L534
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.get_vdp_failure_reason
def get_vdp_failure_reason(self, reply): """Parse the failure reason from VDP. """ try: fail_reason = reply.partition( "filter")[0].replace('\t', '').split('\n')[-2] if len(fail_reason) == 0: fail_reason = vdp_const.retrieve_failure_reason % (reply...
python
def get_vdp_failure_reason(self, reply): """Parse the failure reason from VDP. """ try: fail_reason = reply.partition( "filter")[0].replace('\t', '').split('\n')[-2] if len(fail_reason) == 0: fail_reason = vdp_const.retrieve_failure_reason % (reply...
[ "def", "get_vdp_failure_reason", "(", "self", ",", "reply", ")", ":", "try", ":", "fail_reason", "=", "reply", ".", "partition", "(", "\"filter\"", ")", "[", "0", "]", ".", "replace", "(", "'\\t'", ",", "''", ")", ".", "split", "(", "'\\n'", ")", "["...
Parse the failure reason from VDP.
[ "Parse", "the", "failure", "reason", "from", "VDP", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L536-L545
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.check_filter_validity
def check_filter_validity(self, reply, filter_str): """Check for the validify of the filter. """ try: f_ind = reply.index(filter_str) l_ind = reply.rindex(filter_str) except Exception: fail_reason = vdp_const.filter_failure_reason % (reply) LOG.err...
python
def check_filter_validity(self, reply, filter_str): """Check for the validify of the filter. """ try: f_ind = reply.index(filter_str) l_ind = reply.rindex(filter_str) except Exception: fail_reason = vdp_const.filter_failure_reason % (reply) LOG.err...
[ "def", "check_filter_validity", "(", "self", ",", "reply", ",", "filter_str", ")", ":", "try", ":", "f_ind", "=", "reply", ".", "index", "(", "filter_str", ")", "l_ind", "=", "reply", ".", "rindex", "(", "filter_str", ")", "except", "Exception", ":", "fa...
Check for the validify of the filter.
[ "Check", "for", "the", "validify", "of", "the", "filter", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L547-L561
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.get_vlan_from_associate_reply
def get_vlan_from_associate_reply(self, reply, vsiid, mac): """Parse the associate reply from VDP daemon to get the VLAN value. """ try: verify_flag, fail_reason = self.crosscheck_reply_vsiid_mac( reply, vsiid, mac) if not verify_flag: return const...
python
def get_vlan_from_associate_reply(self, reply, vsiid, mac): """Parse the associate reply from VDP daemon to get the VLAN value. """ try: verify_flag, fail_reason = self.crosscheck_reply_vsiid_mac( reply, vsiid, mac) if not verify_flag: return const...
[ "def", "get_vlan_from_associate_reply", "(", "self", ",", "reply", ",", "vsiid", ",", "mac", ")", ":", "try", ":", "verify_flag", ",", "fail_reason", "=", "self", ".", "crosscheck_reply_vsiid_mac", "(", "reply", ",", "vsiid", ",", "mac", ")", "if", "not", ...
Parse the associate reply from VDP daemon to get the VLAN value.
[ "Parse", "the", "associate", "reply", "from", "VDP", "daemon", "to", "get", "the", "VLAN", "value", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L563-L589
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.check_hints
def check_hints(self, reply): """Parse the hints to check for errors. """ try: f_ind = reply.index("hints") l_ind = reply.rindex("hints") except Exception: fail_reason = vdp_const.hints_failure_reason % (reply) LOG.error("%s", fail_reason) ...
python
def check_hints(self, reply): """Parse the hints to check for errors. """ try: f_ind = reply.index("hints") l_ind = reply.rindex("hints") except Exception: fail_reason = vdp_const.hints_failure_reason % (reply) LOG.error("%s", fail_reason) ...
[ "def", "check_hints", "(", "self", ",", "reply", ")", ":", "try", ":", "f_ind", "=", "reply", ".", "index", "(", "\"hints\"", ")", "l_ind", "=", "reply", ".", "rindex", "(", "\"hints\"", ")", "except", "Exception", ":", "fail_reason", "=", "vdp_const", ...
Parse the hints to check for errors.
[ "Parse", "the", "hints", "to", "check", "for", "errors", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L591-L618
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.get_vlan_from_query_reply
def get_vlan_from_query_reply(self, reply, vsiid, mac): """Parse the query reply from VDP daemon to get the VLAN value. """ hints_ret, fail_reason = self.check_hints(reply) if not hints_ret: LOG.error("Incorrect hints found %s", reply) return constants.INVALID_VLAN, fail_...
python
def get_vlan_from_query_reply(self, reply, vsiid, mac): """Parse the query reply from VDP daemon to get the VLAN value. """ hints_ret, fail_reason = self.check_hints(reply) if not hints_ret: LOG.error("Incorrect hints found %s", reply) return constants.INVALID_VLAN, fail_...
[ "def", "get_vlan_from_query_reply", "(", "self", ",", "reply", ",", "vsiid", ",", "mac", ")", ":", "hints_ret", ",", "fail_reason", "=", "self", ".", "check_hints", "(", "reply", ")", "if", "not", "hints_ret", ":", "LOG", ".", "error", "(", "\"Incorrect hi...
Parse the query reply from VDP daemon to get the VLAN value.
[ "Parse", "the", "query", "reply", "from", "VDP", "daemon", "to", "get", "the", "VLAN", "value", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L620-L642
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.send_vdp_assoc
def send_vdp_assoc(self, vsiid=None, mgrid=None, typeid=None, typeid_ver=None, vsiid_frmt=vdp_const.VDP_VSIFRMT_UUID, filter_frmt=vdp_const.VDP_FILTER_GIDMACVID, gid=0, mac="", vlan=0, oui_id="", oui_data="", sw_resp=False): """Sends the VDP A...
python
def send_vdp_assoc(self, vsiid=None, mgrid=None, typeid=None, typeid_ver=None, vsiid_frmt=vdp_const.VDP_VSIFRMT_UUID, filter_frmt=vdp_const.VDP_FILTER_GIDMACVID, gid=0, mac="", vlan=0, oui_id="", oui_data="", sw_resp=False): """Sends the VDP A...
[ "def", "send_vdp_assoc", "(", "self", ",", "vsiid", "=", "None", ",", "mgrid", "=", "None", ",", "typeid", "=", "None", ",", "typeid_ver", "=", "None", ",", "vsiid_frmt", "=", "vdp_const", ".", "VDP_VSIFRMT_UUID", ",", "filter_frmt", "=", "vdp_const", ".",...
Sends the VDP Associate Message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param vsiid: VSI value, Only UUID supported for now :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID ...
[ "Sends", "the", "VDP", "Associate", "Message", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L644-L683
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.send_vdp_vnic_up
def send_vdp_vnic_up(self, port_uuid=None, vsiid=None, mgrid=None, typeid=None, typeid_ver=None, vsiid_frmt=vdp_const.VDP_VSIFRMT_UUID, filter_frmt=vdp_const.VDP_FILTER_GIDMACVID, gid=0, mac="", vlan=0, oui=None, ...
python
def send_vdp_vnic_up(self, port_uuid=None, vsiid=None, mgrid=None, typeid=None, typeid_ver=None, vsiid_frmt=vdp_const.VDP_VSIFRMT_UUID, filter_frmt=vdp_const.VDP_FILTER_GIDMACVID, gid=0, mac="", vlan=0, oui=None, ...
[ "def", "send_vdp_vnic_up", "(", "self", ",", "port_uuid", "=", "None", ",", "vsiid", "=", "None", ",", "mgrid", "=", "None", ",", "typeid", "=", "None", ",", "typeid_ver", "=", "None", ",", "vsiid_frmt", "=", "vdp_const", ".", "VDP_VSIFRMT_UUID", ",", "f...
Interface function to apps, called for a vNIC UP. This currently sends an VDP associate message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param uuid: uuid of the vNIC :param vsiid: VSI value, Only UUID supported for now ...
[ "Interface", "function", "to", "apps", "called", "for", "a", "vNIC", "UP", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L729-L770
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.send_vdp_vnic_down
def send_vdp_vnic_down(self, port_uuid=None, vsiid=None, mgrid=None, typeid=None, typeid_ver=None, vsiid_frmt=vdp_const.VDP_VSIFRMT_UUID, filter_frmt=vdp_const.VDP_FILTER_GIDMACVID, gid=0, mac="", vlan=0, oui="")...
python
def send_vdp_vnic_down(self, port_uuid=None, vsiid=None, mgrid=None, typeid=None, typeid_ver=None, vsiid_frmt=vdp_const.VDP_VSIFRMT_UUID, filter_frmt=vdp_const.VDP_FILTER_GIDMACVID, gid=0, mac="", vlan=0, oui="")...
[ "def", "send_vdp_vnic_down", "(", "self", ",", "port_uuid", "=", "None", ",", "vsiid", "=", "None", ",", "mgrid", "=", "None", ",", "typeid", "=", "None", ",", "typeid_ver", "=", "None", ",", "vsiid_frmt", "=", "vdp_const", ".", "VDP_VSIFRMT_UUID", ",", ...
Interface function to apps, called for a vNIC DOWN. This currently sends an VDP dis-associate message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param uuid: uuid of the vNIC :param vsiid: VSI value, Only UUID supported fo...
[ "Interface", "function", "to", "apps", "called", "for", "a", "vNIC", "DOWN", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L772-L806
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.run_vdptool
def run_vdptool(self, args, oui_args=None): """Function that runs the vdptool utility. """ if oui_args is None: oui_args = [] full_args = ['vdptool'] + args + oui_args try: return utils.execute(full_args, root_helper=self.root_helper) except Exception as e...
python
def run_vdptool(self, args, oui_args=None): """Function that runs the vdptool utility. """ if oui_args is None: oui_args = [] full_args = ['vdptool'] + args + oui_args try: return utils.execute(full_args, root_helper=self.root_helper) except Exception as e...
[ "def", "run_vdptool", "(", "self", ",", "args", ",", "oui_args", "=", "None", ")", ":", "if", "oui_args", "is", "None", ":", "oui_args", "=", "[", "]", "full_args", "=", "[", "'vdptool'", "]", "+", "args", "+", "oui_args", "try", ":", "return", "util...
Function that runs the vdptool utility.
[ "Function", "that", "runs", "the", "vdptool", "utility", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L808-L818
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
CiscoRoutingPluginApi.get_routers
def get_routers(self, context, router_ids=None, hd_ids=None): """Make a remote process call to retrieve the sync data for routers. :param context: session context :param router_ids: list of routers to fetch :param hd_ids: hosting device ids, only routers assigned to these ...
python
def get_routers(self, context, router_ids=None, hd_ids=None): """Make a remote process call to retrieve the sync data for routers. :param context: session context :param router_ids: list of routers to fetch :param hd_ids: hosting device ids, only routers assigned to these ...
[ "def", "get_routers", "(", "self", ",", "context", ",", "router_ids", "=", "None", ",", "hd_ids", "=", "None", ")", ":", "cctxt", "=", "self", ".", "client", ".", "prepare", "(", "version", "=", "'1.1'", ")", "return", "cctxt", ".", "call", "(", "con...
Make a remote process call to retrieve the sync data for routers. :param context: session context :param router_ids: list of routers to fetch :param hd_ids: hosting device ids, only routers assigned to these hosting devices will be returned.
[ "Make", "a", "remote", "process", "call", "to", "retrieve", "the", "sync", "data", "for", "routers", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L130-L140
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
CiscoRoutingPluginApi.update_floatingip_statuses
def update_floatingip_statuses(self, context, router_id, fip_statuses): """Make a remote process call to update operational status for one or several floating IPs. @param context: contains user information @param router_id: id of router associated with the floatingips @param fip...
python
def update_floatingip_statuses(self, context, router_id, fip_statuses): """Make a remote process call to update operational status for one or several floating IPs. @param context: contains user information @param router_id: id of router associated with the floatingips @param fip...
[ "def", "update_floatingip_statuses", "(", "self", ",", "context", ",", "router_id", ",", "fip_statuses", ")", ":", "cctxt", "=", "self", ".", "client", ".", "prepare", "(", "version", "=", "'1.1'", ")", "return", "cctxt", ".", "call", "(", "context", ",", ...
Make a remote process call to update operational status for one or several floating IPs. @param context: contains user information @param router_id: id of router associated with the floatingips @param fip_statuses: dict with floatingip_id as key and status as value
[ "Make", "a", "remote", "process", "call", "to", "update", "operational", "status", "for", "one", "or", "several", "floating", "IPs", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L155-L165
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
CiscoRoutingPluginApi.send_update_port_statuses
def send_update_port_statuses(self, context, port_ids, status): """Call the pluging to update the port status which updates the DB. :param context: contains user information :param port_ids: list of ids of the ports associated with the status :param status: value of the status for the g...
python
def send_update_port_statuses(self, context, port_ids, status): """Call the pluging to update the port status which updates the DB. :param context: contains user information :param port_ids: list of ids of the ports associated with the status :param status: value of the status for the g...
[ "def", "send_update_port_statuses", "(", "self", ",", "context", ",", "port_ids", ",", "status", ")", ":", "cctxt", "=", "self", ".", "client", ".", "prepare", "(", "version", "=", "'1.1'", ")", "return", "cctxt", ".", "call", "(", "context", ",", "'upda...
Call the pluging to update the port status which updates the DB. :param context: contains user information :param port_ids: list of ids of the ports associated with the status :param status: value of the status for the given port list (port_ids)
[ "Call", "the", "pluging", "to", "update", "the", "port", "status", "which", "updates", "the", "DB", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L167-L176
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper.router_deleted
def router_deleted(self, context, routers): """Deal with router deletion RPC message.""" LOG.debug('Got router deleted notification for %s', routers) self._update_removed_routers_cache(routers)
python
def router_deleted(self, context, routers): """Deal with router deletion RPC message.""" LOG.debug('Got router deleted notification for %s', routers) self._update_removed_routers_cache(routers)
[ "def", "router_deleted", "(", "self", ",", "context", ",", "routers", ")", ":", "LOG", ".", "debug", "(", "'Got router deleted notification for %s'", ",", "routers", ")", "self", ".", "_update_removed_routers_cache", "(", "routers", ")" ]
Deal with router deletion RPC message.
[ "Deal", "with", "router", "deletion", "RPC", "message", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L216-L219
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper.routers_updated
def routers_updated(self, context, routers): """Deal with routers modification and creation RPC message.""" LOG.debug('Got routers updated notification :%s', routers) if routers: # This is needed for backward compatibility if isinstance(routers[0], dict): ...
python
def routers_updated(self, context, routers): """Deal with routers modification and creation RPC message.""" LOG.debug('Got routers updated notification :%s', routers) if routers: # This is needed for backward compatibility if isinstance(routers[0], dict): ...
[ "def", "routers_updated", "(", "self", ",", "context", ",", "routers", ")", ":", "LOG", ".", "debug", "(", "'Got routers updated notification :%s'", ",", "routers", ")", "if", "routers", ":", "if", "isinstance", "(", "routers", "[", "0", "]", ",", "dict", ...
Deal with routers modification and creation RPC message.
[ "Deal", "with", "routers", "modification", "and", "creation", "RPC", "message", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L221-L228
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper.collect_state
def collect_state(self, configurations): """Collect state from this helper. A set of attributes which summarizes the state of the routers and configurations managed by this config agent. :param configurations: dict of configuration values :return dict of updated configuration va...
python
def collect_state(self, configurations): """Collect state from this helper. A set of attributes which summarizes the state of the routers and configurations managed by this config agent. :param configurations: dict of configuration values :return dict of updated configuration va...
[ "def", "collect_state", "(", "self", ",", "configurations", ")", ":", "num_ex_gw_ports", "=", "0", "num_interfaces", "=", "0", "num_floating_ips", "=", "0", "router_infos", "=", "self", ".", "router_info", ".", "values", "(", ")", "num_routers", "=", "len", ...
Collect state from this helper. A set of attributes which summarizes the state of the routers and configurations managed by this config agent. :param configurations: dict of configuration values :return dict of updated configuration values
[ "Collect", "state", "from", "this", "helper", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L317-L351
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._fetch_router_info
def _fetch_router_info(self, router_ids=None, device_ids=None, all_routers=False): """Fetch router dict from the routing plugin. :param router_ids: List of router_ids of routers to fetch :param device_ids: List of device_ids whose routers to fetch :param all_r...
python
def _fetch_router_info(self, router_ids=None, device_ids=None, all_routers=False): """Fetch router dict from the routing plugin. :param router_ids: List of router_ids of routers to fetch :param device_ids: List of device_ids whose routers to fetch :param all_r...
[ "def", "_fetch_router_info", "(", "self", ",", "router_ids", "=", "None", ",", "device_ids", "=", "None", ",", "all_routers", "=", "False", ")", ":", "try", ":", "if", "all_routers", ":", "LOG", ".", "debug", "(", "'Fetching all routers'", ")", "router_ids",...
Fetch router dict from the routing plugin. :param router_ids: List of router_ids of routers to fetch :param device_ids: List of device_ids whose routers to fetch :param all_routers: If True fetch all the routers for this agent. :return: List of router dicts of format: ...
[ "Fetch", "router", "dict", "from", "the", "routing", "plugin", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L406-L455
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._fetch_router_chunk_data
def _fetch_router_chunk_data(self, router_ids=None): """Fetch router data from the routing plugin in chunks. :param router_ids: List of router_ids of routers to fetch :return: List of router dicts of format: [ {router_dict1}, {router_dict2},.....] ...
python
def _fetch_router_chunk_data(self, router_ids=None): """Fetch router data from the routing plugin in chunks. :param router_ids: List of router_ids of routers to fetch :return: List of router dicts of format: [ {router_dict1}, {router_dict2},.....] ...
[ "def", "_fetch_router_chunk_data", "(", "self", ",", "router_ids", "=", "None", ")", ":", "curr_router", "=", "[", "]", "if", "len", "(", "router_ids", ")", ">", "self", ".", "sync_routers_chunk_size", ":", "for", "i", "in", "range", "(", "0", ",", "len"...
Fetch router data from the routing plugin in chunks. :param router_ids: List of router_ids of routers to fetch :return: List of router dicts of format: [ {router_dict1}, {router_dict2},.....]
[ "Fetch", "router", "data", "from", "the", "routing", "plugin", "in", "chunks", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L457-L481
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._handle_sync_devices
def _handle_sync_devices(self, routers): """ Handles routers during a device_sync. This method performs post-processing on routers fetched from the routing plugin during a device sync. Routers are first fetched from the plugin based on the list of device_ids. Since fetched ...
python
def _handle_sync_devices(self, routers): """ Handles routers during a device_sync. This method performs post-processing on routers fetched from the routing plugin during a device sync. Routers are first fetched from the plugin based on the list of device_ids. Since fetched ...
[ "def", "_handle_sync_devices", "(", "self", ",", "routers", ")", ":", "sync_devices_list", "=", "list", "(", "self", ".", "sync_devices", ")", "LOG", ".", "debug", "(", "\"Fetching routers on:%s\"", ",", "sync_devices_list", ")", "fetched_routers", "=", "self", ...
Handles routers during a device_sync. This method performs post-processing on routers fetched from the routing plugin during a device sync. Routers are first fetched from the plugin based on the list of device_ids. Since fetched routers take precedence over pending work, matching rout...
[ "Handles", "routers", "during", "a", "device_sync", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L483-L548
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._get_router_ids_from_removed_devices_info
def _get_router_ids_from_removed_devices_info(removed_devices_info): """Extract router_ids from the removed devices info dict. :param removed_devices_info: Dict of removed devices and their associated resources. Format: { 'hosting_data': {'hd_id1...
python
def _get_router_ids_from_removed_devices_info(removed_devices_info): """Extract router_ids from the removed devices info dict. :param removed_devices_info: Dict of removed devices and their associated resources. Format: { 'hosting_data': {'hd_id1...
[ "def", "_get_router_ids_from_removed_devices_info", "(", "removed_devices_info", ")", ":", "removed_router_ids", "=", "[", "]", "for", "hd_id", ",", "resources", "in", "removed_devices_info", "[", "'hosting_data'", "]", ".", "items", "(", ")", ":", "removed_router_ids...
Extract router_ids from the removed devices info dict. :param removed_devices_info: Dict of removed devices and their associated resources. Format: { 'hosting_data': {'hd_id1': {'routers': [id1, id2, ...]}, 'hd_id2': {'...
[ "Extract", "router_ids", "from", "the", "removed", "devices", "info", "dict", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L551-L569
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._sort_resources_per_hosting_device
def _sort_resources_per_hosting_device(resources): """This function will sort the resources on hosting device. The sorting on hosting device is done by looking up the `hosting_device` attribute of the resource, and its `id`. :param resources: a dict with key of resource name :r...
python
def _sort_resources_per_hosting_device(resources): """This function will sort the resources on hosting device. The sorting on hosting device is done by looking up the `hosting_device` attribute of the resource, and its `id`. :param resources: a dict with key of resource name :r...
[ "def", "_sort_resources_per_hosting_device", "(", "resources", ")", ":", "hosting_devices", "=", "{", "}", "for", "key", "in", "resources", ".", "keys", "(", ")", ":", "for", "r", "in", "resources", ".", "get", "(", "key", ")", "or", "[", "]", ":", "if...
This function will sort the resources on hosting device. The sorting on hosting device is done by looking up the `hosting_device` attribute of the resource, and its `id`. :param resources: a dict with key of resource name :return dict sorted on the hosting device of input resource. For...
[ "This", "function", "will", "sort", "the", "resources", "on", "hosting", "device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L572-L595
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._adjust_router_list_for_global_router
def _adjust_router_list_for_global_router(self, routers): """ Pushes 'Global' routers to the end of the router list, so that deleting default route occurs before deletion of external nw subintf """ #ToDo(Hareesh): Simplify if possible for r in routers: if r[RO...
python
def _adjust_router_list_for_global_router(self, routers): """ Pushes 'Global' routers to the end of the router list, so that deleting default route occurs before deletion of external nw subintf """ #ToDo(Hareesh): Simplify if possible for r in routers: if r[RO...
[ "def", "_adjust_router_list_for_global_router", "(", "self", ",", "routers", ")", ":", "for", "r", "in", "routers", ":", "if", "r", "[", "ROUTER_ROLE_ATTR", "]", "==", "c_constants", ".", "ROUTER_ROLE_GLOBAL", ":", "LOG", ".", "debug", "(", "\"Global router:%s f...
Pushes 'Global' routers to the end of the router list, so that deleting default route occurs before deletion of external nw subintf
[ "Pushes", "Global", "routers", "to", "the", "end", "of", "the", "router", "list", "so", "that", "deleting", "default", "route", "occurs", "before", "deletion", "of", "external", "nw", "subintf" ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L597-L608
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._send_update_port_statuses
def _send_update_port_statuses(self, port_ids, status): """Sends update notifications to set the operational status of the list of router ports provided. To make each notification doesn't exceed the RPC length, each message contains a maximum of MAX_PORTS_IN_BATCH port ids. :par...
python
def _send_update_port_statuses(self, port_ids, status): """Sends update notifications to set the operational status of the list of router ports provided. To make each notification doesn't exceed the RPC length, each message contains a maximum of MAX_PORTS_IN_BATCH port ids. :par...
[ "def", "_send_update_port_statuses", "(", "self", ",", "port_ids", ",", "status", ")", ":", "if", "not", "port_ids", ":", "return", "MAX_PORTS_IN_BATCH", "=", "50", "list_chunks_ports", "=", "[", "port_ids", "[", "i", ":", "i", "+", "MAX_PORTS_IN_BATCH", "]", ...
Sends update notifications to set the operational status of the list of router ports provided. To make each notification doesn't exceed the RPC length, each message contains a maximum of MAX_PORTS_IN_BATCH port ids. :param port_ids: List of ports to update the status :param stat...
[ "Sends", "update", "notifications", "to", "set", "the", "operational", "status", "of", "the", "list", "of", "router", "ports", "provided", ".", "To", "make", "each", "notification", "doesn", "t", "exceed", "the", "RPC", "length", "each", "message", "contains",...
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L728-L746
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._process_router
def _process_router(self, ri): """Process a router, apply latest configuration and update router_info. Get the router dict from RouterInfo and proceed to detect changes from the last known state. When new ports or deleted ports are detected, `internal_network_added()` or `internal_netw...
python
def _process_router(self, ri): """Process a router, apply latest configuration and update router_info. Get the router dict from RouterInfo and proceed to detect changes from the last known state. When new ports or deleted ports are detected, `internal_network_added()` or `internal_netw...
[ "def", "_process_router", "(", "self", ",", "ri", ")", ":", "try", ":", "ex_gw_port", "=", "ri", ".", "router", ".", "get", "(", "'gw_port'", ")", "ri", ".", "ha_info", "=", "ri", ".", "router", ".", "get", "(", "'ha_info'", ",", "None", ")", "gate...
Process a router, apply latest configuration and update router_info. Get the router dict from RouterInfo and proceed to detect changes from the last known state. When new ports or deleted ports are detected, `internal_network_added()` or `internal_networks_removed()` are called accordi...
[ "Process", "a", "router", "apply", "latest", "configuration", "and", "update", "router_info", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L968-L1041
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._process_router_floating_ips
def _process_router_floating_ips(self, ri, ex_gw_port): """Process a router's floating ips. Compare floatingips configured in device (i.e., those fips in the ri.floating_ips "cache") with the router's updated floating ips (in ri.router.floating_ips) and determine floating_ips which were...
python
def _process_router_floating_ips(self, ri, ex_gw_port): """Process a router's floating ips. Compare floatingips configured in device (i.e., those fips in the ri.floating_ips "cache") with the router's updated floating ips (in ri.router.floating_ips) and determine floating_ips which were...
[ "def", "_process_router_floating_ips", "(", "self", ",", "ri", ",", "ex_gw_port", ")", ":", "current_fips", "=", "ri", ".", "router", ".", "get", "(", "bc", ".", "constants", ".", "FLOATINGIP_KEY", ",", "[", "]", ")", "current_fip_ids", "=", "{", "fip", ...
Process a router's floating ips. Compare floatingips configured in device (i.e., those fips in the ri.floating_ips "cache") with the router's updated floating ips (in ri.router.floating_ips) and determine floating_ips which were added or removed. Notify driver of the change via ...
[ "Process", "a", "router", "s", "floating", "ips", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L1043-L1139
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._router_added
def _router_added(self, router_id, router): """Operations when a router is added. Create a new RouterInfo object for this router and add it to the service helpers router_info dictionary. Then `router_added()` is called on the device driver. :param router_id: id of the router ...
python
def _router_added(self, router_id, router): """Operations when a router is added. Create a new RouterInfo object for this router and add it to the service helpers router_info dictionary. Then `router_added()` is called on the device driver. :param router_id: id of the router ...
[ "def", "_router_added", "(", "self", ",", "router_id", ",", "router", ")", ":", "ri", "=", "RouterInfo", "(", "router_id", ",", "router", ")", "driver", "=", "self", ".", "driver_manager", ".", "set_driver", "(", "router", ")", "if", "router", "[", "ROUT...
Operations when a router is added. Create a new RouterInfo object for this router and add it to the service helpers router_info dictionary. Then `router_added()` is called on the device driver. :param router_id: id of the router :param router: router dict :return: None
[ "Operations", "when", "a", "router", "is", "added", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L1141-L1163
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._router_removed
def _router_removed(self, router_id, deconfigure=True): """Operations when a router is removed. Get the RouterInfo object corresponding to the router in the service helpers's router_info dict. If deconfigure is set to True, remove this router's configuration from the hosting device. ...
python
def _router_removed(self, router_id, deconfigure=True): """Operations when a router is removed. Get the RouterInfo object corresponding to the router in the service helpers's router_info dict. If deconfigure is set to True, remove this router's configuration from the hosting device. ...
[ "def", "_router_removed", "(", "self", ",", "router_id", ",", "deconfigure", "=", "True", ")", ":", "ri", "=", "self", ".", "router_info", ".", "get", "(", "router_id", ")", "if", "ri", "is", "None", ":", "LOG", ".", "warning", "(", "\"Info for router %s...
Operations when a router is removed. Get the RouterInfo object corresponding to the router in the service helpers's router_info dict. If deconfigure is set to True, remove this router's configuration from the hosting device. :param router_id: id of the router :param deconfigure:...
[ "Operations", "when", "a", "router", "is", "removed", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L1165-L1218
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._routes_updated
def _routes_updated(self, ri): """Update the state of routes in the router. Compares the current routes with the (configured) existing routes and detect what was removed or added. Then configure the logical router in the hosting device accordingly. :param ri: RouterInfo correspo...
python
def _routes_updated(self, ri): """Update the state of routes in the router. Compares the current routes with the (configured) existing routes and detect what was removed or added. Then configure the logical router in the hosting device accordingly. :param ri: RouterInfo correspo...
[ "def", "_routes_updated", "(", "self", ",", "ri", ")", ":", "new_routes", "=", "ri", ".", "router", "[", "'routes'", "]", "old_routes", "=", "ri", ".", "routes", "adds", ",", "removes", "=", "bc", ".", "common_utils", ".", "diff_list_of_dict", "(", "old_...
Update the state of routes in the router. Compares the current routes with the (configured) existing routes and detect what was removed or added. Then configure the logical router in the hosting device accordingly. :param ri: RouterInfo corresponding to the router. :return: None...
[ "Update", "the", "state", "of", "routes", "in", "the", "router", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L1264-L1292
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_cfg_syncer.py
ConfigSyncer.subintf_real_ip_check_gw_port
def subintf_real_ip_check_gw_port(self, gw_port, ip_addr, netmask): """ checks running-cfg derived ip_addr and netmask against neutron-db gw_port """ if gw_port is not None: found = False for i in range(len(gw_port['fixed_ips'])): target_ip...
python
def subintf_real_ip_check_gw_port(self, gw_port, ip_addr, netmask): """ checks running-cfg derived ip_addr and netmask against neutron-db gw_port """ if gw_port is not None: found = False for i in range(len(gw_port['fixed_ips'])): target_ip...
[ "def", "subintf_real_ip_check_gw_port", "(", "self", ",", "gw_port", ",", "ip_addr", ",", "netmask", ")", ":", "if", "gw_port", "is", "not", "None", ":", "found", "=", "False", "for", "i", "in", "range", "(", "len", "(", "gw_port", "[", "'fixed_ips'", "]...
checks running-cfg derived ip_addr and netmask against neutron-db gw_port
[ "checks", "running", "-", "cfg", "derived", "ip_addr", "and", "netmask", "against", "neutron", "-", "db", "gw_port" ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_cfg_syncer.py#L900-L925
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver._get_connection
def _get_connection(self): """Make SSH connection to the IOS XE device. The external ncclient library is used for creating this connection. This method keeps state of any existing connections and reuses them if already connected. Also interfaces (except management) are typically ...
python
def _get_connection(self): """Make SSH connection to the IOS XE device. The external ncclient library is used for creating this connection. This method keeps state of any existing connections and reuses them if already connected. Also interfaces (except management) are typically ...
[ "def", "_get_connection", "(", "self", ")", ":", "try", ":", "if", "self", ".", "_ncc_connection", "and", "self", ".", "_ncc_connection", ".", "connected", ":", "return", "self", ".", "_ncc_connection", "else", ":", "self", ".", "_ncc_connection", "=", "mana...
Make SSH connection to the IOS XE device. The external ncclient library is used for creating this connection. This method keeps state of any existing connections and reuses them if already connected. Also interfaces (except management) are typically disabled by default when it is booted...
[ "Make", "SSH", "connection", "to", "the", "IOS", "XE", "device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L257-L285
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver._get_interfaces
def _get_interfaces(self): """Get a list of interfaces on this hosting device. :return: List of the interfaces """ ios_cfg = self._get_running_config() parse = HTParser(ios_cfg) itfcs_raw = parse.find_lines("^interface GigabitEthernet") itfcs = [raw_if.strip().sp...
python
def _get_interfaces(self): """Get a list of interfaces on this hosting device. :return: List of the interfaces """ ios_cfg = self._get_running_config() parse = HTParser(ios_cfg) itfcs_raw = parse.find_lines("^interface GigabitEthernet") itfcs = [raw_if.strip().sp...
[ "def", "_get_interfaces", "(", "self", ")", ":", "ios_cfg", "=", "self", ".", "_get_running_config", "(", ")", "parse", "=", "HTParser", "(", "ios_cfg", ")", "itfcs_raw", "=", "parse", ".", "find_lines", "(", "\"^interface GigabitEthernet\"", ")", "itfcs", "="...
Get a list of interfaces on this hosting device. :return: List of the interfaces
[ "Get", "a", "list", "of", "interfaces", "on", "this", "hosting", "device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L295-L305
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver._get_interface_ip
def _get_interface_ip(self, interface_name): """Get the ip address for an interface. :param interface_name: interface_name as a string :return: ip address of interface as a string """ ios_cfg = self._get_running_config() parse = HTParser(ios_cfg) children = parse...
python
def _get_interface_ip(self, interface_name): """Get the ip address for an interface. :param interface_name: interface_name as a string :return: ip address of interface as a string """ ios_cfg = self._get_running_config() parse = HTParser(ios_cfg) children = parse...
[ "def", "_get_interface_ip", "(", "self", ",", "interface_name", ")", ":", "ios_cfg", "=", "self", ".", "_get_running_config", "(", ")", "parse", "=", "HTParser", "(", "ios_cfg", ")", "children", "=", "parse", ".", "find_children", "(", "\"^interface %s\"", "%"...
Get the ip address for an interface. :param interface_name: interface_name as a string :return: ip address of interface as a string
[ "Get", "the", "ip", "address", "for", "an", "interface", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L307-L322
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver._interface_exists
def _interface_exists(self, interface): """Check whether interface exists.""" ios_cfg = self._get_running_config() parse = HTParser(ios_cfg) itfcs_raw = parse.find_lines("^interface " + interface) return len(itfcs_raw) > 0
python
def _interface_exists(self, interface): """Check whether interface exists.""" ios_cfg = self._get_running_config() parse = HTParser(ios_cfg) itfcs_raw = parse.find_lines("^interface " + interface) return len(itfcs_raw) > 0
[ "def", "_interface_exists", "(", "self", ",", "interface", ")", ":", "ios_cfg", "=", "self", ".", "_get_running_config", "(", ")", "parse", "=", "HTParser", "(", "ios_cfg", ")", "itfcs_raw", "=", "parse", ".", "find_lines", "(", "\"^interface \"", "+", "inte...
Check whether interface exists.
[ "Check", "whether", "interface", "exists", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L324-L329
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver._get_vrfs
def _get_vrfs(self): """Get the current VRFs configured in the device. :return: A list of vrf names as string """ vrfs = [] ios_cfg = self._get_running_config() parse = HTParser(ios_cfg) vrfs_raw = parse.find_lines("^vrf definition") for line in vrfs_raw:...
python
def _get_vrfs(self): """Get the current VRFs configured in the device. :return: A list of vrf names as string """ vrfs = [] ios_cfg = self._get_running_config() parse = HTParser(ios_cfg) vrfs_raw = parse.find_lines("^vrf definition") for line in vrfs_raw:...
[ "def", "_get_vrfs", "(", "self", ")", ":", "vrfs", "=", "[", "]", "ios_cfg", "=", "self", ".", "_get_running_config", "(", ")", "parse", "=", "HTParser", "(", "ios_cfg", ")", "vrfs_raw", "=", "parse", ".", "find_lines", "(", "\"^vrf definition\"", ")", "...
Get the current VRFs configured in the device. :return: A list of vrf names as string
[ "Get", "the", "current", "VRFs", "configured", "in", "the", "device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L339-L353
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver._get_capabilities
def _get_capabilities(self): """Get the servers NETCONF capabilities. :return: List of server capabilities. """ conn = self._get_connection() capabilities = [] for c in conn.server_capabilities: capabilities.append(c) LOG.debug("Server capabilities: %...
python
def _get_capabilities(self): """Get the servers NETCONF capabilities. :return: List of server capabilities. """ conn = self._get_connection() capabilities = [] for c in conn.server_capabilities: capabilities.append(c) LOG.debug("Server capabilities: %...
[ "def", "_get_capabilities", "(", "self", ")", ":", "conn", "=", "self", ".", "_get_connection", "(", ")", "capabilities", "=", "[", "]", "for", "c", "in", "conn", ".", "server_capabilities", ":", "capabilities", ".", "append", "(", "c", ")", "LOG", ".", ...
Get the servers NETCONF capabilities. :return: List of server capabilities.
[ "Get", "the", "servers", "NETCONF", "capabilities", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L355-L365
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver._get_running_config
def _get_running_config(self, split=True): """Get the IOS XE device's current running config. :return: Current IOS running config as multiline string """ conn = self._get_connection() config = conn.get_config(source="running") if config: root = ET.fromstring(...
python
def _get_running_config(self, split=True): """Get the IOS XE device's current running config. :return: Current IOS running config as multiline string """ conn = self._get_connection() config = conn.get_config(source="running") if config: root = ET.fromstring(...
[ "def", "_get_running_config", "(", "self", ",", "split", "=", "True", ")", ":", "conn", "=", "self", ".", "_get_connection", "(", ")", "config", "=", "conn", ".", "get_config", "(", "source", "=", "\"running\"", ")", "if", "config", ":", "root", "=", "...
Get the IOS XE device's current running config. :return: Current IOS running config as multiline string
[ "Get", "the", "IOS", "XE", "device", "s", "current", "running", "config", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L367-L382
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver._check_acl
def _check_acl(self, acl_no, network, netmask): """Check a ACL config exists in the running config. :param acl_no: access control list (ACL) number :param network: network which this ACL permits :param netmask: netmask of the network :return: """ exp_cfg_lines = ...
python
def _check_acl(self, acl_no, network, netmask): """Check a ACL config exists in the running config. :param acl_no: access control list (ACL) number :param network: network which this ACL permits :param netmask: netmask of the network :return: """ exp_cfg_lines = ...
[ "def", "_check_acl", "(", "self", ",", "acl_no", ",", "network", ",", "netmask", ")", ":", "exp_cfg_lines", "=", "[", "'ip access-list standard '", "+", "str", "(", "acl_no", ")", ",", "' permit '", "+", "str", "(", "network", ")", "+", "' '", "+", "str"...
Check a ACL config exists in the running config. :param acl_no: access control list (ACL) number :param network: network which this ACL permits :param netmask: netmask of the network :return:
[ "Check", "a", "ACL", "config", "exists", "in", "the", "running", "config", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L384-L403
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver._cfg_exists
def _cfg_exists(self, cfg_str): """Check a partial config string exists in the running config. :param cfg_str: config string to check :return : True or False """ ios_cfg = self._get_running_config() parse = HTParser(ios_cfg) cfg_raw = parse.find_lines("^" + cfg_s...
python
def _cfg_exists(self, cfg_str): """Check a partial config string exists in the running config. :param cfg_str: config string to check :return : True or False """ ios_cfg = self._get_running_config() parse = HTParser(ios_cfg) cfg_raw = parse.find_lines("^" + cfg_s...
[ "def", "_cfg_exists", "(", "self", ",", "cfg_str", ")", ":", "ios_cfg", "=", "self", ".", "_get_running_config", "(", ")", "parse", "=", "HTParser", "(", "ios_cfg", ")", "cfg_raw", "=", "parse", ".", "find_lines", "(", "\"^\"", "+", "cfg_str", ")", "LOG"...
Check a partial config string exists in the running config. :param cfg_str: config string to check :return : True or False
[ "Check", "a", "partial", "config", "string", "exists", "in", "the", "running", "config", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L405-L415
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver._check_response
def _check_response(self, rpc_obj, snippet_name, conf_str=None): """This function checks the rpc response object for status. This function takes as input the response rpc_obj and the snippet name that was executed. It parses it to see, if the last edit operation was a success or not. ...
python
def _check_response(self, rpc_obj, snippet_name, conf_str=None): """This function checks the rpc response object for status. This function takes as input the response rpc_obj and the snippet name that was executed. It parses it to see, if the last edit operation was a success or not. ...
[ "def", "_check_response", "(", "self", ",", "rpc_obj", ",", "snippet_name", ",", "conf_str", "=", "None", ")", ":", "LOG", ".", "debug", "(", "\"RPCReply for %(snippet_name)s is %(rpc_obj)s\"", ",", "{", "'snippet_name'", ":", "snippet_name", ",", "'rpc_obj'", ":"...
This function checks the rpc response object for status. This function takes as input the response rpc_obj and the snippet name that was executed. It parses it to see, if the last edit operation was a success or not. <?xml version="1.0" encoding="UTF-8"?> <rpc-reply mess...
[ "This", "function", "checks", "the", "rpc", "response", "object", "for", "status", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L600-L639
train
openstack/networking-cisco
networking_cisco/apps/saf/server/dfa_instance_api.py
DFAInstanceAPI._get_instances_for_project
def _get_instances_for_project(self, project_id): """Return all instances for a given project. :project_id: UUID of project (tenant) """ search_opts = {'marker': None, 'all_tenants': True, 'project_id': project_id} try: s...
python
def _get_instances_for_project(self, project_id): """Return all instances for a given project. :project_id: UUID of project (tenant) """ search_opts = {'marker': None, 'all_tenants': True, 'project_id': project_id} try: s...
[ "def", "_get_instances_for_project", "(", "self", ",", "project_id", ")", ":", "search_opts", "=", "{", "'marker'", ":", "None", ",", "'all_tenants'", ":", "True", ",", "'project_id'", ":", "project_id", "}", "try", ":", "servers", "=", "self", ".", "_novacl...
Return all instances for a given project. :project_id: UUID of project (tenant)
[ "Return", "all", "instances", "for", "a", "given", "project", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_instance_api.py#L65-L86
train
openstack/networking-cisco
networking_cisco/apps/saf/server/dfa_instance_api.py
DFAInstanceAPI.get_instance_for_uuid
def get_instance_for_uuid(self, uuid, project_id): """Return instance name for given uuid of an instance and project. :uuid: Instance's UUID :project_id: UUID of project (tenant) """ instance_name = self._inst_info_cache.get((uuid, project_id)) if instance_name: ...
python
def get_instance_for_uuid(self, uuid, project_id): """Return instance name for given uuid of an instance and project. :uuid: Instance's UUID :project_id: UUID of project (tenant) """ instance_name = self._inst_info_cache.get((uuid, project_id)) if instance_name: ...
[ "def", "get_instance_for_uuid", "(", "self", ",", "uuid", ",", "project_id", ")", ":", "instance_name", "=", "self", ".", "_inst_info_cache", ".", "get", "(", "(", "uuid", ",", "project_id", ")", ")", "if", "instance_name", ":", "return", "instance_name", "i...
Return instance name for given uuid of an instance and project. :uuid: Instance's UUID :project_id: UUID of project (tenant)
[ "Return", "instance", "name", "for", "given", "uuid", "of", "an", "instance", "and", "project", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_instance_api.py#L88-L104
train