aboutsummaryrefslogtreecommitdiffstats
path: root/onap-client/onap_client/engine.py
diff options
context:
space:
mode:
authorstark, steven <steven.stark@att.com>2020-04-07 08:36:44 -0700
committerstark, steven <steven.stark@att.com>2020-04-07 08:36:44 -0700
commit298508191ae545ecf6eb2b7a56fd1d0828f20f0e (patch)
tree9685dc85589fa2a395fc03f733299e63a3b77fd6 /onap-client/onap_client/engine.py
parent07c28e0a81383f76f5d563f265db27519d4922f1 (diff)
[VVP] Adding support for update to onap-client
Issue-ID: VVP-399 Signed-off-by: stark, steven <steven.stark@att.com> Change-Id: I3f7d1694fd23295a274c0c0e3801a33ab23dce7f
Diffstat (limited to 'onap-client/onap_client/engine.py')
-rw-r--r--onap-client/onap_client/engine.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/onap-client/onap_client/engine.py b/onap-client/onap_client/engine.py
index 7543783..a352163 100644
--- a/onap-client/onap_client/engine.py
+++ b/onap-client/onap_client/engine.py
@@ -70,7 +70,7 @@ def show_resource_spec(resource_name):
list_spec_resources()
-def load_spec(input_spec, validate_only=False):
+def load_spec(input_spec, validate_only=False, submit=True):
try:
with open(input_spec, "r") as f:
jdata = json.loads(f.read())
@@ -79,7 +79,7 @@ def load_spec(input_spec, validate_only=False):
raise
engine = SpecEngine()
- return engine.load_spec(jdata, validate_only=validate_only)
+ return engine.load_spec(jdata, validate_only=validate_only, distribute=submit)
def spec_cli(args):
@@ -102,6 +102,10 @@ def spec_cli(args):
)
parser.add_argument(
+ "--no-submit", action="store_false", required=False, default=True, help="Dont execute submit() for each resource in spec."
+ )
+
+ parser.add_argument(
"--list-spec-resources",
action="store_true",
required=False,
@@ -117,7 +121,7 @@ def spec_cli(args):
elif arguments.validate_spec:
print(json.dumps(load_spec(arguments.validate_spec, validate_only=True), indent=4))
elif arguments.load_spec:
- load_spec(arguments.load_spec)
+ load_spec(arguments.load_spec, submit=arguments.no_submit)
class SpecEngine: