diff options
author | Vijay Venkatesh Kumar <vv770d@att.com> | 2022-08-18 15:14:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-08-18 15:14:35 +0000 |
commit | 56591bbb09719e040b15cc8842e4bf6b18e28962 (patch) | |
tree | 0b71b8c7efb2f4a705e98a1cd4bb4c98a1af845e /mod/distributorapi/distributor/data_access.py | |
parent | 743c1d1034101fa676e98b6ffbf39592e2ca8b20 (diff) | |
parent | c83d2369eb2f0ac40d5acd2db2d7350fe86101e5 (diff) |
Merge "codecoverage improvement"
Diffstat (limited to 'mod/distributorapi/distributor/data_access.py')
-rw-r--r-- | mod/distributorapi/distributor/data_access.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mod/distributorapi/distributor/data_access.py b/mod/distributorapi/distributor/data_access.py index e1a45e3..5b544d8 100644 --- a/mod/distributorapi/distributor/data_access.py +++ b/mod/distributorapi/distributor/data_access.py @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2019-2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,9 +29,10 @@ def get_distribution_targets(): def get_distribution_target(ds_id): global _cache - result = [ i for i in _cache if i["dt_id"] == ds_id ] + result = [i for i in _cache if i["dt_id"] == ds_id] return result[0] if result else {} + def transform_request(req): """Transform request to object to store @@ -44,6 +45,7 @@ def transform_request(req): req["processGroups"] = [] return req + def add_distribution_target(dt): global _cache _cache.append(dt) @@ -58,6 +60,7 @@ def merge_request(dt, req): dt["modified"] = datetime.utcnow().isoformat() return dt + def update_distribution_target(updated_dt): dt_id = updated_dt["dt_id"] global _cache @@ -85,5 +88,3 @@ def add_process_group(ds_id, process_group): dt["processGroups"].append(process_group) return process_group return None - - |