Loading src/nbi/service/sse_telemetry/delete_subscription.py +7 −10 Original line number Diff line number Diff line Loading @@ -37,8 +37,6 @@ from nbi.service.sse_telemetry.topology import ( get_controller_name, ) from .database_tmp import SERVICE_ID LOGGER = logging.getLogger(__name__) Loading @@ -46,8 +44,6 @@ LOGGER = logging.getLogger(__name__) class DeleteSubscription(Resource): # @HTTP_AUTH.login_required def post(self): global SERVICE_ID db = Engine.get_engine() if db is None: LOGGER.error('Database engine is not initialized') Loading Loading @@ -79,6 +75,7 @@ class DeleteSubscription(Resource): # Unsubscribe from each sub-subscription for sub_sub in sub_subscriptions: # Create unsubscribe request SERVICE_ID = '' device_controller = get_controller_name(sub_sub['xpath'], SERVICE_ID, context_client) if device_controller == Controllers.CONTROLLERLESS: LOGGER.warning( Loading @@ -105,11 +102,11 @@ class DeleteSubscription(Resource): LOGGER.info('Successfully deleted main subscription: {:s}'.format(main_subscription_id)) if SERVICE_ID == 'simap1': SERVICE_ID = 'simap2' elif SERVICE_ID == 'simap2': SERVICE_ID = 'simap1' else: LOGGER.warning('Unknown service ID, not switching: {:s}'.format(SERVICE_ID)) #if SERVICE_ID == 'simap1': # SERVICE_ID = 'simap2' #elif SERVICE_ID == 'simap2': # SERVICE_ID = 'simap1' #else: # LOGGER.warning('Unknown service ID, not switching: {:s}'.format(SERVICE_ID)) return jsonify({}) Loading
src/nbi/service/sse_telemetry/delete_subscription.py +7 −10 Original line number Diff line number Diff line Loading @@ -37,8 +37,6 @@ from nbi.service.sse_telemetry.topology import ( get_controller_name, ) from .database_tmp import SERVICE_ID LOGGER = logging.getLogger(__name__) Loading @@ -46,8 +44,6 @@ LOGGER = logging.getLogger(__name__) class DeleteSubscription(Resource): # @HTTP_AUTH.login_required def post(self): global SERVICE_ID db = Engine.get_engine() if db is None: LOGGER.error('Database engine is not initialized') Loading Loading @@ -79,6 +75,7 @@ class DeleteSubscription(Resource): # Unsubscribe from each sub-subscription for sub_sub in sub_subscriptions: # Create unsubscribe request SERVICE_ID = '' device_controller = get_controller_name(sub_sub['xpath'], SERVICE_ID, context_client) if device_controller == Controllers.CONTROLLERLESS: LOGGER.warning( Loading @@ -105,11 +102,11 @@ class DeleteSubscription(Resource): LOGGER.info('Successfully deleted main subscription: {:s}'.format(main_subscription_id)) if SERVICE_ID == 'simap1': SERVICE_ID = 'simap2' elif SERVICE_ID == 'simap2': SERVICE_ID = 'simap1' else: LOGGER.warning('Unknown service ID, not switching: {:s}'.format(SERVICE_ID)) #if SERVICE_ID == 'simap1': # SERVICE_ID = 'simap2' #elif SERVICE_ID == 'simap2': # SERVICE_ID = 'simap1' #else: # LOGGER.warning('Unknown service ID, not switching: {:s}'.format(SERVICE_ID)) return jsonify({})