summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py
diff options
context:
space:
mode:
authorraviteja.karumuri <raviteja.karumuri@est.tech>2022-03-02 17:59:27 +0000
committerraviteja.karumuri <raviteja.karumuri@est.tech>2022-03-03 16:54:04 +0000
commit5a2c43f2add2c6d4af8331a40b174684eac11b34 (patch)
tree4e76bac8e33d80b1e0e9af1fdf2b57fe6a9a7bf2 /components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py
parent5f69c24ad78121a2840b5299583791e557f8b535 (diff)
[PMSH] Cleaning up old App Config, subscription handler and it's subsequent calls
Issue-ID: DCAEGEN2-3085 Signed-off-by: Raviteja, Karumuri <raviteja.karumuri@est.tech> Change-Id: I7b862648eebf59844aaa9d09697b7f2a693c9d94
Diffstat (limited to 'components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py')
-rw-r--r--components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py b/components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py
index 5065ce8a..cfcda091 100644
--- a/components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py
+++ b/components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py
@@ -16,9 +16,11 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=====================================================
import json
+
+from mod.api.services.measurement_group_service import mg_nf_states, \
+ AdministrativeState, MgNfState
from mod.pmsh_config import MRTopic, AppConfig
from mod import logger
-from mod.subscription import AdministrativeState, subscription_nf_states, SubNfState
from mod.api.db_models import MeasurementGroupModel, NfMeasureGroupRelationalModel
from mod.api.services import measurement_group_service
@@ -96,12 +98,12 @@ class PolicyResponseHandler:
NfMeasureGroupRelationalModel.measurement_grp_name == measurement_group_name,
NfMeasureGroupRelationalModel.nf_name == nf_name
).one_or_none()
- if nf_msg_rel.nf_measure_grp_status == SubNfState.PENDING_DELETE.value:
+ if nf_msg_rel.nf_measure_grp_status == MgNfState.PENDING_DELETE.value:
administrative_state = AdministrativeState.LOCKING.value
- elif nf_msg_rel.nf_measure_grp_status == SubNfState.PENDING_CREATE.value:
+ elif nf_msg_rel.nf_measure_grp_status == MgNfState.PENDING_CREATE.value:
administrative_state = AdministrativeState.UNLOCKED.value
- nf_measure_grp_status = (subscription_nf_states[administrative_state]
+ nf_measure_grp_status = (mg_nf_states[administrative_state]
[response_message]).value
policy_response_handle_functions[administrative_state][response_message](
measurement_group_name=measurement_group_name, status=nf_measure_grp_status,