Merge "Updated changes from IM module to introduce operational state upgrading"
diff --git a/common/python/rift/mano/utils/juju_api.py b/common/python/rift/mano/utils/juju_api.py
index 40ff14c..81d54a9 100755
--- a/common/python/rift/mano/utils/juju_api.py
+++ b/common/python/rift/mano/utils/juju_api.py
@@ -206,8 +206,10 @@
await self.login()
app = None
- if application in self.model.applications:
- app = self.model.applications[application]
+ if self.model:
+ if self.model.applications:
+ if application in self.model.applications:
+ app = self.model.applications[application]
return app
async def get_application_status(self, application, status=None):
diff --git a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py
index 0b7ecae..33aeed6 100644
--- a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py
+++ b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py
@@ -251,7 +251,6 @@
if service in self._tasks:
tasks = []
for action in self._tasks[service].keys():
- #if self.check_task_status(service, action):
tasks.append(action)
del tasks
except KeyError as e:
@@ -270,35 +269,6 @@
"""
return True
- def check_task_status(self, service, action):
- #self.log.debug("jujuCA: check task status for %s, %s" % (service, action))
- try:
- task = self._tasks[service][action]
- if task.done():
- self.log.debug("jujuCA: Task for %s, %s done" % (service, action))
- e = task.exception()
- if e:
- self.log.error("jujuCA: Error in task for {} and {} : {}".
- format(service, action, e))
- raise Exception(e)
- r= task.result()
- if r:
- self.log.debug("jujuCA: Task for {} and {}, returned {}".
- format(service, action,r))
- return True
- else:
- self.log.debug("jujuCA: task {}, {} not done".
- format(service, action))
- return False
- except KeyError as e:
- self.log.error("jujuCA: KeyError for task for {} and {}: {}".
- format(service, action, e))
- except Exception as e:
- self.log.error("jujuCA: Error for task for {} and {}: {}".
- format(service, action, e))
- raise
- return True
-
@asyncio.coroutine
def _vnf_config_primitive(self, nsr_id, vnfr_id, primitive,
vnf_config=None, wait=False):
@@ -732,12 +702,13 @@
rc = 'configuring'
- if not self.check_task_status(service, 'deploy'):
- return rc
-
try:
- resp = yield from self.api.get_service_status(application=service)
- self._log.debug("jujuCA: Get service %s status? %s", service, resp)
+ # Get the status of the application
+ resp = yield from self.api.get_application_status(service)
+
+ # No status means the application is still pending deployment
+ if resp is None:
+ return rc
if resp == 'error':
return 'error'
diff --git a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py
index fa933ba..ea66806 100644
--- a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py
+++ b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py
@@ -196,7 +196,7 @@
@property
def openmano_vnfd(self):
self._log.debug("Converting vnfd %s from rift to openmano", self.vnfd.id)
- openmano_vnfd = rift2openmano.rift2openmano_vnfd(self.vnfd, self.nsd, self._http_api, self._project)
+ openmano_vnfd = rift2openmano.rift2openmano_vnfd(self.vnfd, self.nsd, self._http_api, self._project.name)
return openmano_vnfd
@property