diff options
author | shabs2020 <shabnam.sultana@highstreet-technologies.com> | 2021-01-07 16:59:48 +0100 |
---|---|---|
committer | shabs2020 <shabnam.sultana@highstreet-technologies.com> | 2021-01-07 19:38:24 +0100 |
commit | aeabc22ba7e3befc9c19286418c136189b76db37 (patch) | |
tree | caf2d8ca00cff95ff196037af90e7fd518dab56d /adapter/acumos/aoconversion | |
parent | a3c8fc0395e9518c5f0f064a033f4ab4d7040c61 (diff) |
Modify metadata matcher
Add additional condition to check name metadata for correct selection of metadata.json artifact by Acumos adapter
Issue-ID: DCAEGEN2-2578
Signed-off-by: shabs2020 <shabnam.sultana@highstreet-technologies.com>
Change-Id: I76aacd854d1f6c7dff08321e9ecfd030172c07bd
Signed-off-by: shabs2020 <shabnam.sultana@highstreet-technologies.com>
Diffstat (limited to 'adapter/acumos/aoconversion')
-rw-r--r-- | adapter/acumos/aoconversion/scanner.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/adapter/acumos/aoconversion/scanner.py b/adapter/acumos/aoconversion/scanner.py index aecf760..cefcc3d 100644 --- a/adapter/acumos/aoconversion/scanner.py +++ b/adapter/acumos/aoconversion/scanner.py @@ -116,7 +116,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 +136,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)) |