Fix project delete failures
Signed-off-by: Philip Joseph <philip.joseph@riftio.com>
diff --git a/common/python/rift/mano/cloud/config.py b/common/python/rift/mano/cloud/config.py
index f7906fd..a5ed7b5 100644
--- a/common/python/rift/mano/cloud/config.py
+++ b/common/python/rift/mano/cloud/config.py
@@ -128,6 +128,7 @@
self._reg.deregister()
self._reg = None
+ @asyncio.coroutine
def register(self):
@asyncio.coroutine
def apply_config(dts, acg, xact, action, scratch):
diff --git a/common/python/rift/mano/cloud/operdata.py b/common/python/rift/mano/cloud/operdata.py
index a86f638..59084ef 100644
--- a/common/python/rift/mano/cloud/operdata.py
+++ b/common/python/rift/mano/cloud/operdata.py
@@ -73,6 +73,7 @@
self._log.info("Notification called by creating dts query: %s", ac_status)
+ @asyncio.coroutine
def _register_show_status(self):
def get_xpath(cloud_name=None):
return "D,/rw-cloud:cloud/account{}/connection-status".format(
@@ -83,7 +84,8 @@
def on_prepare(xact_info, action, ks_path, msg):
path_entry = RwCloudYang.CloudAcc.schema().keyspec_to_entry(ks_path)
cloud_account_name = path_entry.key00.name
- self._log.debug("Got show cloud connection status request: %s", ks_path.create_string())
+ self._log.debug("Got show cloud connection status request (action: %s): %s",
+ xact_info.query_action, ks_path.create_string())
try:
saved_accounts = self.get_saved_cloud_accounts(cloud_account_name)
@@ -111,6 +113,7 @@
flags=rwdts.Flag.PUBLISHER,
)
+ @asyncio.coroutine
def _register_validate_rpc(self):
def get_xpath():
return "/rw-cloud:update-cloud-status"
@@ -150,9 +153,11 @@
@asyncio.coroutine
def register(self):
+ self._log.debug("Register cloud account for project %s", self._project.name)
yield from self._register_show_status()
yield from self._register_validate_rpc()
def deregister(self):
- yield from self._rpc.deregister()
- yield from self._regh.deregister()
+ self._log.debug("De-register cloud account for project %s", self._project.name)
+ self._rpc.deregister()
+ self._regh.deregister()
diff --git a/common/python/rift/mano/dts/subscriber/core.py b/common/python/rift/mano/dts/subscriber/core.py
index ebd38f9..a2181e8 100644
--- a/common/python/rift/mano/dts/subscriber/core.py
+++ b/common/python/rift/mano/dts/subscriber/core.py
@@ -161,11 +161,6 @@
def register(self):
""" Register for VNFD configuration"""
- if self.reg:
- self._log.warning("RPC already registered for project {}".
- format(self._project.name))
- return
-
def on_apply(dts, acg, xact, action, scratch):
"""Apply the configuration"""
is_recovery = xact.xact is None and action == rwdts.AppconfAction.INSTALL
@@ -188,6 +183,8 @@
@asyncio.coroutine
def on_prepare(dts, acg, xact, xact_info, ks_path, msg, scratch):
""" on prepare callback """
+ self._log.debug("Subscriber DTS prepare for project %s: %s",
+ self.project, xact_info.query_action)
xact_info.respond_xpath(rwdts.XactRspCode.ACK)
acg_hdl = rift.tasklets.AppConfGroup.Handler(on_apply=on_apply)