Loading src/device/service/drivers/nce/NCEDriver.py +2 −2 Original line number Diff line number Diff line Loading @@ -179,7 +179,7 @@ class NCEDriver(_Driver): if len(resources) == 0: return results with self.__lock: for resource in resources: LOGGER.info('resource = {:s}'.format(str(resource))) LOGGER.info('[SetConfig] resource = {:s}'.format(str(resource))) resource_key, resource_value = resource if not RE_NCE_APP_FLOW_DATA.match(resource_key): continue Loading @@ -199,7 +199,7 @@ class NCEDriver(_Driver): if len(resources) == 0: return results with self.__lock: for resource in resources: LOGGER.info('resource = {:s}'.format(str(resource))) LOGGER.info('[DeleteConfig] resource = {:s}'.format(str(resource))) resource_key, resource_value = resource if not RE_NCE_APP_FLOW_DATA.match(resource_key): continue Loading src/device/service/drivers/nce/handlers/AppFlowHandler.py +9 −3 Original line number Diff line number Diff line Loading @@ -47,8 +47,10 @@ class AppFlowHandler: ) for qos_profile in qos_profiles: request = {'huawei-nce-app-flow:qos-profiles': {'qos-profile': qos_profile}} qos_profile_name = qos_profile['name'] LOGGER.info('Creating QoS Profile: {:s}'.format(str(request))) self._rest_conf_client.post(self._url_qos_profile, body=request) url = self._url_qos_profile_item.format(qos_profile_name) self._rest_conf_client.post(url, body=request) applications = ( data Loading @@ -58,8 +60,10 @@ class AppFlowHandler: ) for application in applications: request = {'huawei-nce-app-flow:applications': {'application': application}} application_name = application['name'] LOGGER.info('Creating Application: {:s}'.format(str(request))) self._rest_conf_client.post(self._url_application, body=request) url = self._url_application_item.format(application_name) self._rest_conf_client.post(url, body=request) app_flows = ( data Loading @@ -68,8 +72,10 @@ class AppFlowHandler: ) for app_flow in app_flows: request = {'huawei-nce-app-flow:app-flows': {'app-flow': app_flow}} app_flow_name = app_flow['name'] LOGGER.info('Creating App Flow: {:s}'.format(str(request))) self._rest_conf_client.post(self._url_app_flow, body=request) url = self._url_app_flow_item.format(app_flow_name) self._rest_conf_client.post(url, body=request) except requests.exceptions.ConnectionError as e: MSG = 'Failed to send POST requests to NCE FAN NBI' Loading Loading
src/device/service/drivers/nce/NCEDriver.py +2 −2 Original line number Diff line number Diff line Loading @@ -179,7 +179,7 @@ class NCEDriver(_Driver): if len(resources) == 0: return results with self.__lock: for resource in resources: LOGGER.info('resource = {:s}'.format(str(resource))) LOGGER.info('[SetConfig] resource = {:s}'.format(str(resource))) resource_key, resource_value = resource if not RE_NCE_APP_FLOW_DATA.match(resource_key): continue Loading @@ -199,7 +199,7 @@ class NCEDriver(_Driver): if len(resources) == 0: return results with self.__lock: for resource in resources: LOGGER.info('resource = {:s}'.format(str(resource))) LOGGER.info('[DeleteConfig] resource = {:s}'.format(str(resource))) resource_key, resource_value = resource if not RE_NCE_APP_FLOW_DATA.match(resource_key): continue Loading
src/device/service/drivers/nce/handlers/AppFlowHandler.py +9 −3 Original line number Diff line number Diff line Loading @@ -47,8 +47,10 @@ class AppFlowHandler: ) for qos_profile in qos_profiles: request = {'huawei-nce-app-flow:qos-profiles': {'qos-profile': qos_profile}} qos_profile_name = qos_profile['name'] LOGGER.info('Creating QoS Profile: {:s}'.format(str(request))) self._rest_conf_client.post(self._url_qos_profile, body=request) url = self._url_qos_profile_item.format(qos_profile_name) self._rest_conf_client.post(url, body=request) applications = ( data Loading @@ -58,8 +60,10 @@ class AppFlowHandler: ) for application in applications: request = {'huawei-nce-app-flow:applications': {'application': application}} application_name = application['name'] LOGGER.info('Creating Application: {:s}'.format(str(request))) self._rest_conf_client.post(self._url_application, body=request) url = self._url_application_item.format(application_name) self._rest_conf_client.post(url, body=request) app_flows = ( data Loading @@ -68,8 +72,10 @@ class AppFlowHandler: ) for app_flow in app_flows: request = {'huawei-nce-app-flow:app-flows': {'app-flow': app_flow}} app_flow_name = app_flow['name'] LOGGER.info('Creating App Flow: {:s}'.format(str(request))) self._rest_conf_client.post(self._url_app_flow, body=request) url = self._url_app_flow_item.format(app_flow_name) self._rest_conf_client.post(url, body=request) except requests.exceptions.ConnectionError as e: MSG = 'Failed to send POST requests to NCE FAN NBI' Loading