Call k8sclusterjuju.install with ensure future 95/8395/2
authorDominik Fleischmann <dominik.fleischmann@canonical.com>
Thu, 12 Dec 2019 16:26:49 +0000 (17:26 +0100)
committerDominik Fleischmann <dominik.fleischmann@canonical.com>
Thu, 12 Dec 2019 16:39:56 +0000 (17:39 +0100)
This fixes the bug 971, due to the function not being called
like this the type of the task variable wasn't correct for the
rest of execution.

https://osm.etsi.org/bugzilla/show_bug.cgi?id=971

Change-Id: I47266a04332579cb7ee54e5d45189164ccca7b40
Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com>
osm_lcm/ns.py

index de1c6a0..87eaecd 100644 (file)
@@ -1673,9 +1673,11 @@ class NsLcm(LcmBase):
                                                         params=desc_params, db_dict=db_dict, timeout=3600)
                         )
                     else:
-                        task = self.k8sclusterjuju.install(cluster_uuid=cluster_uuid, kdu_model=kdumodel,
-                                                           atomic=True, params=desc_params,
-                                                           db_dict=db_dict, timeout=600)
+                        task = asyncio.ensure_future(
+                            self.k8sclusterjuju.install(cluster_uuid=cluster_uuid, kdu_model=kdumodel,
+                                                        atomic=True, params=desc_params,
+                                                        db_dict=db_dict, timeout=600)
+                        )
 
                     pending_tasks[task] = "_admin.deployed.K8s.{}.".format(index)
                     index += 1