From: garciadeblas Date: Fri, 11 Mar 2022 09:52:50 +0000 (+0100) Subject: Add timeout param for ns-create X-Git-Tag: v12.0.0rc1~17 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fosmclient.git;a=commitdiff_plain;h=b66761bd5f0c65dcec418a27ebfd83a56eec7e91 Add timeout param for ns-create Change-Id: I82c26a21c3d4f2f96771bda1a4b2a7588ce1315c Signed-off-by: garciadeblas --- diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index 2182346..0e63958 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -2350,6 +2350,7 @@ def nfpkg_create( help="do not return the control immediately, but keep it " "until the operation is completed, or timeout", ) +@click.option("--timeout", default=None, help="ns deployment timeout") @click.pass_context def ns_create( ctx, @@ -2361,6 +2362,7 @@ def ns_create( config, config_file, wait, + timeout ): """creates a new NS instance""" logger.debug("") @@ -2380,6 +2382,7 @@ def ns_create( ssh_keys=ssh_keys, account=vim_account, wait=wait, + timeout=timeout, ) # except ClientException as e: # print(str(e)) diff --git a/osmclient/sol005/ns.py b/osmclient/sol005/ns.py index ac40aad..f4366b2 100644 --- a/osmclient/sol005/ns.py +++ b/osmclient/sol005/ns.py @@ -163,6 +163,7 @@ class Ns(object): description="default description", admin_status="ENABLED", wait=False, + timeout=None, ): self._logger.debug("") self._client.get_token() @@ -209,6 +210,8 @@ class Ns(object): for pubkeyfile in ssh_keys.split(","): with open(pubkeyfile, "r") as f: ns["ssh_keys"].append(f.read()) + if timeout: + ns["timeout_ns_deploy"] = timeout if config: ns_config = yaml.safe_load(config) if "vim-network-name" in ns_config: