Commit adffe11e authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

NBI Component - SSE Telemetry:

- Minor fix
parent 05ab026c
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -37,8 +37,6 @@ from nbi.service.sse_telemetry.topology import (
    get_controller_name,
)

from .database_tmp import SERVICE_ID


LOGGER = logging.getLogger(__name__)

@@ -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')
@@ -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(
@@ -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({})