X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=adapter%2Facumos%2Faoconversion%2Fscanner.py;h=f8b453126ad6e694e4919ba7a951f60a595cdfe9;hb=f3637436673c64344e9fa6828cb907e8d101bf3e;hp=aecf76075616b934f3379a5e3476c5c38a40d2e6;hpb=ba3d7306c1773ea78ad7a87468fc66b9b4f18551;p=dcaegen2%2Fplatform.git diff --git a/adapter/acumos/aoconversion/scanner.py b/adapter/acumos/aoconversion/scanner.py index aecf760..f8b45312 100644 --- a/adapter/acumos/aoconversion/scanner.py +++ b/adapter/acumos/aoconversion/scanner.py @@ -2,6 +2,7 @@ # org.onap.dcae # ============================================================================= # Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2021 highstreet technologies GmbH. 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. @@ -47,7 +48,7 @@ class Config(object): Configuration parameters as attributes, make sure the required ones are there, populate defaults. """ - def __init__(self, dcaeuser, onboardingurl, onboardinguser, onboardingpass, certfile, dockerregistry, dockeruser, dockerpass, acumosurl=None, interval=900, dockerhost='tcp://localhost:2375', tmpdir='/var/tmp/aoadapter', certverify=True, catalogs=None, port=None, **extras): + def __init__(self, dcaeuser, onboardingurl, onboardinguser, onboardingpass, certfile, dockerregistry, dockeruser, dockerpass, http_proxy, https_proxy, no_proxy, acumosurl=None, interval=900, dockerhost='tcp://localhost:2375', tmpdir='/var/tmp/aoadapter', certverify=True, catalogs=None, port=None, **extras): self.dcaeuser = dcaeuser def x(fmt, *args, **kwargs): @@ -64,6 +65,9 @@ class Config(object): self._dockerpass = dockerpass self.interval = interval self.tmpdir = tmpdir + self.http_proxy = http_proxy if http_proxy is not None else "" + self.https_proxy = https_proxy if http_proxy is not None else "" + self.no_proxy = no_proxy if no_proxy is not None else "" if catalogs is not None and type(catalogs) is not list: catalogs = [catalogs] self.catalogs = catalogs @@ -116,7 +120,7 @@ def _x_zip_matcher(art): def _md_json_matcher(art): """ Is this artifact the metadata.json file? """ - return art['name'].endswith('.json') + return art['name'].__contains__('metadata') & art['name'].endswith('.json') def _walk(config): @@ -136,6 +140,7 @@ def _walk(config): def onboard(aa, callback, solution, revid): + xrev = aa.jsonget('/solutions/{}/revisions/{}', solution['solutionId'], revid) callback(model_name=solution['name'], model_version=xrev['version'], model_last_updated=xrev['modified'], rating=solution['ratingAverageTenths'] / 10.0, proto_getter=aa.artgetter(xrev, _x_proto_matcher), zip_getter=aa.artgetter(xrev, _x_zip_matcher), metadata_getter=aa.artgetter(xrev, _md_json_matcher))