From b247b7b1d89aec6cf9bc46782b49903277b725e7 Mon Sep 17 00:00:00 2001 From: "Gitelman, Tal (tg851x)" Date: Wed, 14 Mar 2018 20:04:22 +0200 Subject: Onap normatives are imported always Change-Id: I3f35be9732a4b0ddba268debe1766976402fa560 Issue-ID: SDC-1103 Signed-off-by: Gitelman, Tal (tg851x) --- .../scripts/import/tosca/upgradeONAPNormative.py | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py') diff --git a/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py b/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py index b272c2726c..21a477503c 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py @@ -11,7 +11,7 @@ from importPolicyTypes import importPolicyTypes from importGroupTypes import importGroupTypes from importNormativeCapabilities import importNormativeCapabilities from importNormativeInterfaceLifecycleTypes import importNormativeInterfaceLifecycleType -from importOnapTypes import importOnapTypes +from upgradeONAPTypes import upgradeOnapTypesPerConfigFile from importCommon import * @@ -33,15 +33,17 @@ import importCommon def usage(): print sys.argv[0], '[-i | --ip=] [-p | --port= ] [-u | --user= ] [-d | --debug=]' -def handleResults(results, updateversion): - printFrameLine() - for result in results: - printNameAndReturnCode(result[0], result[1]) - printFrameLine() +def handleResults(results): + if results is not None: + printFrameLine() + for result in results: + printNameAndReturnCode(result[0], result[1]) + + printFrameLine() - failedResults = filter(lambda x: x[1] == None or x[1] not in [200, 201, 409], results) - if (len(failedResults) > 0): - errorAndExit(1, None) + failedResults = filter(lambda x: x[1] == None or x[1] not in [200, 201, 409], results) + if (len(failedResults) > 0): + errorAndExit(1, None) def main(argv): print 'Number of arguments:', len(sys.argv), 'arguments.' @@ -51,6 +53,7 @@ def main(argv): adminUser = 'jh0003' debugf = None updateversion = 'true' + updateOnapVersion = 'false' importCommon.debugFlag = False scheme = 'http' @@ -115,11 +118,10 @@ def main(argv): time.sleep( 70 ) resultsHeat = upgradeTypesPerConfigFile(scheme, beHost, bePort, adminUser, baseFileLocation, updateversion) - handleResults(resultsHeat, 'false') + handleResults(resultsHeat) - fileLocation = baseFileLocation + "onap-types/" - resultsHeat = importOnapTypes(scheme, beHost, bePort, adminUser, fileLocation, updateversion) - handleResults(resultsHeat, updateversion) + resultsHeat = upgradeOnapTypesPerConfigFile(scheme, beHost, bePort, adminUser, baseFileLocation, updateOnapVersion) + handleResults(resultsHeat) errorAndExit(0, None) -- cgit 1.2.3-korg