repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
openstack/networking-cisco
networking_cisco/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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L283-L288
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L327-L333
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L335-L340
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L342-L346
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L348-L352
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L354-L360
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L362-L367
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L369-L396
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L398-L401
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L403-L423
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py
FwMgr._delete_fw_fab_dev
def _delete_fw_fab_dev(self, tenant_id, drvr_name, fw_dict): """Deletes the Firewall. This routine calls the fabric class to delete the fabric when a firewall is deleted. It also calls the device manager to unconfigure the device. It updates the database with the final result. ...
python
def _delete_fw_fab_dev(self, tenant_id, drvr_name, fw_dict): """Deletes the Firewall. This routine calls the fabric class to delete the fabric when a firewall is deleted. It also calls the device manager to unconfigure the device. It updates the database with the final result. ...
[ "def", "_delete_fw_fab_dev", "(", "self", ",", "tenant_id", ",", "drvr_name", ",", "fw_dict", ")", ":", "is_fw_virt", "=", "self", ".", "is_device_virtual", "(", ")", "if", "self", ".", "fwid_attr", "[", "tenant_id", "]", ".", "is_fw_drvr_created", "(", ")",...
Deletes the Firewall. This routine calls the fabric class to delete the fabric when a firewall is deleted. It also calls the device manager to unconfigure the device. It updates the database with the final result.
[ "Deletes", "the", "Firewall", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L425-L453
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L455-L471
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L473-L481
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L496-L537
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L539-L545
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L548-L581
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L583-L586
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L589-L606
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L612-L624
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L627-L651
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L653-L656
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L659-L671
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L673-L676
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L679-L695
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L697-L700
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L703-L715
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L717-L720
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L723-L752
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L754-L757
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L759-L770
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L772-L782
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L784-L816
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L818-L848
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L850-L886
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L888-L905
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L907-L919
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", ":", "# For both create and delete case", "fw_data", "=", ...
This routine is called for retrying the delete cases.
[ "This", "routine", "is", "called", "for", "retrying", "the", "delete", "cases", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L921-L943
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/fw_mgr.py#L945-L953
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/common/htparser.py#L80-L95
openstack/networking-cisco
networking_cisco/plugins/cisco/common/htparser.py
HTParser.find_lines
def find_lines(self, linespec): """Find lines that match the linespec regex.""" res = [] linespec += ".*" for line in self.cfg: match = re.search(linespec, line) if match: res.append(match.group(0)) return res
python
def find_lines(self, linespec): """Find lines that match the linespec regex.""" res = [] linespec += ".*" for line in self.cfg: match = re.search(linespec, line) if match: res.append(match.group(0)) return res
[ "def", "find_lines", "(", "self", ",", "linespec", ")", ":", "res", "=", "[", "]", "linespec", "+=", "\".*\"", "for", "line", "in", "self", ".", "cfg", ":", "match", "=", "re", ".", "search", "(", "linespec", ",", "line", ")", "if", "match", ":", ...
Find lines that match the linespec regex.
[ "Find", "lines", "that", "match", "the", "linespec", "regex", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/common/htparser.py#L105-L113
openstack/networking-cisco
networking_cisco/plugins/cisco/common/htparser.py
HTParser.find_objects
def find_objects(self, linespec): """Find lines that match the linespec regex. :param linespec: regular expression of line to match :return: list of LineItem objects """ # Note(asr1kteam): In this code we are only adding children one-level # deep to a given parent (lines...
python
def find_objects(self, linespec): """Find lines that match the linespec regex. :param linespec: regular expression of line to match :return: list of LineItem objects """ # Note(asr1kteam): In this code we are only adding children one-level # deep to a given parent (lines...
[ "def", "find_objects", "(", "self", ",", "linespec", ")", ":", "# Note(asr1kteam): In this code we are only adding children one-level", "# deep to a given parent (linespec), as that satisfies the IOS conf", "# parsing.", "# Note(asr1kteam): Not tested with tabs in the config. Currently used", ...
Find lines that match the linespec regex. :param linespec: regular expression of line to match :return: list of LineItem objects
[ "Find", "lines", "that", "match", "the", "linespec", "regex", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/common/htparser.py#L115-L142
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/common/htparser.py#L144-L155
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
enable_lldp
def enable_lldp(self, port_name, is_ncb=True, is_nb=False): """Function to enable LLDP on the interface. """ if is_ncb: self.run_lldptool(["-L", "-i", port_name, "-g", "ncb", "adminStatus=rxtx"]) if is_nb: self.run_lldptool(["-L", "-i", port_name, "-g", "nb", ...
python
def enable_lldp(self, port_name, is_ncb=True, is_nb=False): """Function to enable LLDP on the interface. """ if is_ncb: self.run_lldptool(["-L", "-i", port_name, "-g", "ncb", "adminStatus=rxtx"]) if is_nb: self.run_lldptool(["-L", "-i", port_name, "-g", "nb", ...
[ "def", "enable_lldp", "(", "self", ",", "port_name", ",", "is_ncb", "=", "True", ",", "is_nb", "=", "False", ")", ":", "if", "is_ncb", ":", "self", ".", "run_lldptool", "(", "[", "\"-L\"", ",", "\"-i\"", ",", "port_name", ",", "\"-g\"", ",", "\"ncb\"",...
Function to enable LLDP on the interface.
[ "Function", "to", "enable", "LLDP", "on", "the", "interface", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L44-L52
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.enable_lldp
def enable_lldp(self): """Function to enable LLDP on the interface. """ if self.is_ncb: self.run_lldptool(["-L", "-i", self.port_name, "-g", "ncb", "adminStatus=rxtx"]) if self.is_nb: self.run_lldptool(["-L", "-i", self.port_name, "-g", "nb"...
python
def enable_lldp(self): """Function to enable LLDP on the interface. """ if self.is_ncb: self.run_lldptool(["-L", "-i", self.port_name, "-g", "ncb", "adminStatus=rxtx"]) if self.is_nb: self.run_lldptool(["-L", "-i", self.port_name, "-g", "nb"...
[ "def", "enable_lldp", "(", "self", ")", ":", "if", "self", ".", "is_ncb", ":", "self", ".", "run_lldptool", "(", "[", "\"-L\"", ",", "\"-i\"", ",", "self", ".", "port_name", ",", "\"-g\"", ",", "\"ncb\"", ",", "\"adminStatus=rxtx\"", "]", ")", "if", "s...
Function to enable LLDP on the interface.
[ "Function", "to", "enable", "LLDP", "on", "the", "interface", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L106-L113
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L115-L124
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L126-L137
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L140-L204
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.run_lldptool
def run_lldptool(self, args): """Function for invoking the lldptool utility. """ full_args = ['lldptool'] + args try: utils.execute(full_args, root_helper=self.root_helper) except Exception as e: LOG.error("Unable to execute %(cmd)s. " "Excep...
python
def run_lldptool(self, args): """Function for invoking the lldptool utility. """ full_args = ['lldptool'] + args try: utils.execute(full_args, root_helper=self.root_helper) except Exception as e: LOG.error("Unable to execute %(cmd)s. " "Excep...
[ "def", "run_lldptool", "(", "self", ",", "args", ")", ":", "full_args", "=", "[", "'lldptool'", "]", "+", "args", "try", ":", "utils", ".", "execute", "(", "full_args", ",", "root_helper", "=", "self", ".", "root_helper", ")", "except", "Exception", "as"...
Function for invoking the lldptool utility.
[ "Function", "for", "invoking", "the", "lldptool", "utility", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L206-L214
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L216-L224
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.store_vdp_vsi
def store_vdp_vsi(self, port_uuid, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, new_network, reply, oui_id, oui_data, vsw_cb_fn, vsw_cb_data, reason): """Stores the vNIC specific info for VDP Refresh. :param...
python
def store_vdp_vsi(self, port_uuid, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, new_network, reply, oui_id, oui_data, vsw_cb_fn, vsw_cb_data, reason): """Stores the vNIC specific info for VDP Refresh. :param...
[ "def", "store_vdp_vsi", "(", "self", ",", "port_uuid", ",", "mgrid", ",", "typeid", ",", "typeid_ver", ",", "vsiid_frmt", ",", "vsiid", ",", "filter_frmt", ",", "gid", ",", "mac", ",", "vlan", ",", "new_network", ",", "reply", ",", "oui_id", ",", "oui_da...
Stores the vNIC specific info for VDP Refresh. :param uuid: vNIC UUID :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID :param vsiid_frmt: Format of the following VSI argument :param vsiid: VSI value :param filter_frmt: Filter ...
[ "Stores", "the", "vNIC", "specific", "info", "for", "VDP", "Refresh", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L226-L274
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L276-L286
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/lldpad.py
LldpadDriver.clear_vdp_vsi
def clear_vdp_vsi(self, port_uuid): """Stores the vNIC specific info for VDP Refresh. :param uuid: vNIC UUID """ try: LOG.debug("Clearing VDP VSI MAC %(mac)s UUID %(uuid)s", {'mac': self.vdp_vif_map[port_uuid].get('mac'), 'uuid': ...
python
def clear_vdp_vsi(self, port_uuid): """Stores the vNIC specific info for VDP Refresh. :param uuid: vNIC UUID """ try: LOG.debug("Clearing VDP VSI MAC %(mac)s UUID %(uuid)s", {'mac': self.vdp_vif_map[port_uuid].get('mac'), 'uuid': ...
[ "def", "clear_vdp_vsi", "(", "self", ",", "port_uuid", ")", ":", "try", ":", "LOG", ".", "debug", "(", "\"Clearing VDP VSI MAC %(mac)s UUID %(uuid)s\"", ",", "{", "'mac'", ":", "self", ".", "vdp_vif_map", "[", "port_uuid", "]", ".", "get", "(", "'mac'", ")",...
Stores the vNIC specific info for VDP Refresh. :param uuid: vNIC UUID
[ "Stores", "the", "vNIC", "specific", "info", "for", "VDP", "Refresh", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L288-L300
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L302-L320
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L322-L328
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L330-L402
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L404-L442
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L444-L502
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L520-L534
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L536-L545
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L547-L561
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L563-L589
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L591-L618
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L620-L642
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L644-L683
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L729-L770
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L772-L806
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/lldpad.py#L808-L818
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L130-L140
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L155-L165
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L167-L176
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L216-L219
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", ":", "# This is needed for backward compatibility", "if", "isinstance", "(", "r...
Deal with routers modification and creation RPC message.
[ "Deal", "with", "routers", "modification", "and", "creation", "RPC", "message", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L221-L228
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L317-L351
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L406-L455
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", ":", "# fetch routers by chunks to reduce the load on server and",...
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L457-L481
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L483-L548
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L551-L569
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L572-L595
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", ")", ":", "#ToDo(Hareesh): Simplify if possible", "for", "r", "in", "routers", ":", "if", "r", "[", "ROUTER_ROLE_ATTR", "]", "==", "c_constants", ".", "ROUTER_ROLE_GLOBAL", ":", "LOG", ".",...
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" ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L597-L608
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
RoutingServiceHelper._process_routers
def _process_routers(self, routers, removed_routers, device_id=None, all_routers=False): """Process the set of routers. Iterating on the set of routers received and comparing it with the set of routers already in the routing service helper, new routers which are...
python
def _process_routers(self, routers, removed_routers, device_id=None, all_routers=False): """Process the set of routers. Iterating on the set of routers received and comparing it with the set of routers already in the routing service helper, new routers which are...
[ "def", "_process_routers", "(", "self", ",", "routers", ",", "removed_routers", ",", "device_id", "=", "None", ",", "all_routers", "=", "False", ")", ":", "try", ":", "ids_previously_hosted_routers", "=", "(", "set", "(", "r_id", "for", "r_id", ",", "rdata",...
Process the set of routers. Iterating on the set of routers received and comparing it with the set of routers already in the routing service helper, new routers which are added are identified. Before processing check the reachability (via ping) of hosting device where the router is host...
[ "Process", "the", "set", "of", "routers", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L610-L726
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",...
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L728-L746
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L968-L1041
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", ")", ":", "# fips that exist in neutron db (i.e., the desired \"truth\")", "current_fips", "=", "ri", ".", "router", ".", "get", "(", "bc", ".", "constants", ".", "FLOATINGIP_KEY", ",", ...
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L1043-L1139
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L1141-L1163
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L1165-L1218
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py#L1264-L1292
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_cfg_syncer.py
ConfigSyncer.get_running_config
def get_running_config(self, conn): """Get the ASR1k's current running config. :return: Current IOS running config as multiline string """ config = conn.get_config(source="running") if config: root = ET.fromstring(config._raw) running_config = root[0][0] ...
python
def get_running_config(self, conn): """Get the ASR1k's current running config. :return: Current IOS running config as multiline string """ config = conn.get_config(source="running") if config: root = ET.fromstring(config._raw) running_config = root[0][0] ...
[ "def", "get_running_config", "(", "self", ",", "conn", ")", ":", "config", "=", "conn", ".", "get_config", "(", "source", "=", "\"running\"", ")", "if", "config", ":", "root", "=", "ET", ".", "fromstring", "(", "config", ".", "_raw", ")", "running_config...
Get the ASR1k's current running config. :return: Current IOS running config as multiline string
[ "Get", "the", "ASR1k", "s", "current", "running", "config", ".", ":", "return", ":", "Current", "IOS", "running", "config", "as", "multiline", "string" ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_cfg_syncer.py#L326-L336
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" ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_cfg_syncer.py#L900-L925
openstack/networking-cisco
networking_cisco/plugins/cisco/common/utils.py
retry
def retry(ExceptionToCheck, tries=4, delay=3, backoff=2): """Retry calling the decorated function using an exponential backoff. Reference: http://www.saltycrane.com/blog/2009/11/trying-out-retry -decorator-python/ :param ExceptionToCheck: the exception to check. may be a tuple of exceptions to...
python
def retry(ExceptionToCheck, tries=4, delay=3, backoff=2): """Retry calling the decorated function using an exponential backoff. Reference: http://www.saltycrane.com/blog/2009/11/trying-out-retry -decorator-python/ :param ExceptionToCheck: the exception to check. may be a tuple of exceptions to...
[ "def", "retry", "(", "ExceptionToCheck", ",", "tries", "=", "4", ",", "delay", "=", "3", ",", "backoff", "=", "2", ")", ":", "def", "deco_retry", "(", "f", ")", ":", "@", "wraps", "(", "f", ")", "def", "f_retry", "(", "*", "args", ",", "*", "*"...
Retry calling the decorated function using an exponential backoff. Reference: http://www.saltycrane.com/blog/2009/11/trying-out-retry -decorator-python/ :param ExceptionToCheck: the exception to check. may be a tuple of exceptions to check :param tries: number of times to try (not retry) befor...
[ "Retry", "calling", "the", "decorated", "function", "using", "an", "exponential", "backoff", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/common/utils.py#L32-L65
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", ":", "# ncclient needs 'name' to be 'csr' in order to c...
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L257-L285
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L295-L305
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L307-L322
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L324-L329
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L339-L353
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L355-L365
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L367-L382
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L384-L403
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L405-L415
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py
IosXeRoutingDriver.caller_name
def caller_name(self, skip=2): """ Get a name of a caller in the format module.class.method `skip` specifies how many levels of stack to skip while getting caller name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. An empty string is returned if skipped levels exc...
python
def caller_name(self, skip=2): """ Get a name of a caller in the format module.class.method `skip` specifies how many levels of stack to skip while getting caller name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. An empty string is returned if skipped levels exc...
[ "def", "caller_name", "(", "self", ",", "skip", "=", "2", ")", ":", "stack", "=", "inspect", ".", "stack", "(", ")", "start", "=", "0", "+", "skip", "if", "len", "(", "stack", ")", "<", "start", "+", "1", ":", "return", "''", "parentframe", "=", ...
Get a name of a caller in the format module.class.method `skip` specifies how many levels of stack to skip while getting caller name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. An empty string is returned if skipped levels exceed stack height
[ "Get", "a", "name", "of", "a", "caller", "in", "the", "format", "module", ".", "class", ".", "method" ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L530-L561
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", "." ]
train
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/iosxe/iosxe_routing_driver.py#L600-L639