diff options
author | 2022-02-18 15:20:14 +0000 | |
---|---|---|
committer | 2022-02-22 09:27:16 +0000 | |
commit | 37762006756658532012d9b8e4286e80acb612c4 (patch) | |
tree | d8bbd23cd1f66cc02c6a45f9d40193bc201519e1 /components/pm-subscription-handler/pmsh_service/mod/api | |
parent | eabbdce7cba8c04a852cad47b0731b88030e1856 (diff) |
[PMSH] Fixes for Flask, MarkupSafe versions + tox
Fixes due to version issues and minor fixes for tox and unit test
Patch 3+4: Version bump
Issue-ID: DCAEGEN2-3086
Signed-off-by: egernug <gerard.nugent@est.tech>
Change-Id: Ibbb83bb50f96737ad127c4c2463957500f7581db
Diffstat (limited to 'components/pm-subscription-handler/pmsh_service/mod/api')
-rwxr-xr-x | components/pm-subscription-handler/pmsh_service/mod/api/controller.py | 10 | ||||
-rw-r--r-- | components/pm-subscription-handler/pmsh_service/mod/api/services/measurement_group_service.py | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/components/pm-subscription-handler/pmsh_service/mod/api/controller.py b/components/pm-subscription-handler/pmsh_service/mod/api/controller.py index 7f4f28f5..de3aa5f3 100755 --- a/components/pm-subscription-handler/pmsh_service/mod/api/controller.py +++ b/components/pm-subscription-handler/pmsh_service/mod/api/controller.py @@ -167,14 +167,16 @@ def delete_meas_group_by_name(subscription_name, measurement_group_name): logger.info(f'API call received to delete measurement group: {measurement_group_name}') try: measurement_group_administrative_status = \ - measurement_group_service.query_get_meas_group_admin_status(subscription_name, measurement_group_name) + measurement_group_service.query_get_meas_group_admin_status(subscription_name, + measurement_group_name) if measurement_group_administrative_status == AdministrativeState.LOCKED.value: - if measurement_group_service.query_to_delete_meas_group(subscription_name, measurement_group_name) == 1: + if measurement_group_service.query_to_delete_meas_group(subscription_name, + measurement_group_name) == 1: return None, HTTPStatus.NO_CONTENT else: logger.error(f'Measurement Group not found with name {measurement_group_name}') - return {'error': f'Measurement Group not found with name {measurement_group_name}'}, \ - HTTPStatus.NOT_FOUND.value + return {'error': f'Measurement Group not found with name ' + f'{measurement_group_name}'}, HTTPStatus.NOT_FOUND.value else: logger.error('Measurement Group was not deleted because the Administrative State ' f'was {measurement_group_administrative_status}') diff --git a/components/pm-subscription-handler/pmsh_service/mod/api/services/measurement_group_service.py b/components/pm-subscription-handler/pmsh_service/mod/api/services/measurement_group_service.py index 998c0b19..b272e5b8 100644 --- a/components/pm-subscription-handler/pmsh_service/mod/api/services/measurement_group_service.py +++ b/components/pm-subscription-handler/pmsh_service/mod/api/services/measurement_group_service.py @@ -170,7 +170,8 @@ def query_to_delete_meas_group(subscription_name, measurement_group_name): int: Returns '1' if subscription exists and deleted successfully else '0' """ affected_rows = db.session.query(MeasurementGroupModel) \ - .filter_by(subscription_name=subscription_name, measurement_group_name=measurement_group_name).delete() + .filter_by(subscription_name=subscription_name, + measurement_group_name=measurement_group_name).delete() db.session.commit() return affected_rows |