summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py
diff options
context:
space:
mode:
authork.kedron <k.kedron@partner.samsung.com>2020-03-05 13:12:27 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-06-24 06:01:11 +0000
commitcb30f3a566b73c78c3ea666acfcd3f288098684a (patch)
tree38cd1acb83ddde2b927485611d130bbeec3c1a4b /catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py
parentbdbfc2e460ccb561c3e174260b2908b974996d4f (diff)
Refactoring the sdc-BE-init python scripts
Deeper refactoring of python script: - create the python package with init script - support for python 3.x - reuse code - new design - support for .json conf file - update the docker chef script Issue-ID: SDC-2784 Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com> Change-Id: I02169eb7d0e3e90851ba1811536d1712c3b4145f
Diffstat (limited to 'catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py')
-rw-r--r--catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py
new file mode 100644
index 0000000000..ee4e05b21a
--- /dev/null
+++ b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python3
+
+import sys
+
+from sdcBePy.common.normative.toscaTypes import process_and_create_normative_types
+from sdcBePy.tosca.main import get_args, usage
+from sdcBePy.tosca.models.normativeTypesList import get_normative, get_heat, get_nfv, get_onap, get_sol
+
+
+def run(candidate, exit_on_success=True):
+ scheme, be_host, be_port, admin_user, update_version, debug = get_args()
+ try:
+ process_and_create_normative_types(candidate,
+ scheme,
+ be_host,
+ be_port,
+ admin_user,
+ update_version=update_version,
+ debug=debug,
+ exit_on_success=exit_on_success)
+ except AttributeError:
+ usage()
+ sys.exit(3)
+
+
+def run_import_normative():
+ normative_candidate = get_normative()
+ run(normative_candidate)
+
+
+def run_import_heat():
+ heat_candidate = get_heat()
+ run(heat_candidate)
+
+
+def run_import_nfv():
+ nfv_candidate = get_nfv()
+ run(nfv_candidate)
+
+
+def run_import_onap():
+ onap_candidate = get_onap()
+ run(onap_candidate)
+
+
+def run_import_sol():
+ sol_candidate = get_sol()
+ run(sol_candidate)
+
+
+if __name__ == '__main__':
+ run_import_normative()
+ # run_import_heat()
+ # run_import_nfv()
+ # run_import_onap()
+ # run_import_sol()