diff options
author | Sastry Isukapalli <sastry@research.att.com> | 2018-02-11 21:09:32 -0500 |
---|---|---|
committer | Sastry Isukapalli <sastry@research.att.com> | 2018-02-11 21:16:26 -0500 |
commit | 2d2ac618f8538fe243c292540fedfbf45e19b118 (patch) | |
tree | f8dbb42efb35d7e79a56978dfbd2e2cb03cbe0e0 /osdf/optimizers/licenseopt/simple_license_allocation.py | |
parent | 0b855c08fd98fb8fa0f4bc40d8df430c897b4bad (diff) |
Removed unused DB-adapters, test cases, 60+% cover
We are not using OracleDB, PostgresDB, and VerticaDB, so there is no
need to keep the "dead code" -- we can always add it back as needed.
Added test cases so that all the files are at least minimally covered.
Overall coverage on my local tox shows 66% coverage (I manually ensured
all files are included in the coverage report).
Issue-ID: OPTFRA-95
Change-Id: If1cab112236b4f32a96315308ce815088fa092d1
Signed-off-by: Sastry Isukapalli <sastry@research.att.com>
Diffstat (limited to 'osdf/optimizers/licenseopt/simple_license_allocation.py')
-rw-r--r-- | osdf/optimizers/licenseopt/simple_license_allocation.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/osdf/optimizers/licenseopt/simple_license_allocation.py b/osdf/optimizers/licenseopt/simple_license_allocation.py index 1b5b670..beafbe4 100644 --- a/osdf/optimizers/licenseopt/simple_license_allocation.py +++ b/osdf/optimizers/licenseopt/simple_license_allocation.py @@ -19,10 +19,9 @@ import json from requests import RequestException -from osdf.datasources.sdc import sdc, constraint_handler +from osdf.adapters.sdc import sdc, constraint_handler from osdf.logging.osdf_logging import audit_log, metrics_log, MH from osdf.config.base import osdf_config -from osdf.utils import data_mapping def license_optim(request_json): @@ -36,11 +35,12 @@ def license_optim(request_json): config = osdf_config.deployment model_name = request_json['placementInfo']['serviceModelInfo']['modelName'] - service_name = data_mapping.get_service_type(model_name) + # service_name = data_mapping.get_service_type(model_name) + service_name = model_name license_info = [] - order_info = json.loads(request_json["placementInfo"]["orderInfo"]) + order_info = json.loads(request_json["placementInfo"]["requestParameters"]) if service_name == 'VPE': data_mapping.normalize_user_params(order_info) for licenseDemand in request_json['placementInfo']['demandInfo']['licenseDemand']: |