Add timeout param for ns-create 41/11741/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 11 Mar 2022 09:52:50 +0000 (10:52 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 11 Mar 2022 09:52:50 +0000 (10:52 +0100)
Change-Id: I82c26a21c3d4f2f96771bda1a4b2a7588ce1315c
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osmclient/scripts/osm.py
osmclient/sol005/ns.py

index 2182346..0e63958 100755 (executable)
@@ -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))
index ac40aad..f4366b2 100644 (file)
@@ -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: