From: garciadeblas Date: Thu, 3 Apr 2025 11:43:57 +0000 (+0200) Subject: Call cloud_credentials.add only in VIM operations when VIM account has credentials X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=981c62e093f153951097d6308bfd3ae93d89729c;p=osm%2FLCM.git Call cloud_credentials.add only in VIM operations when VIM account has credentials Change-Id: I1e3888b9aed2b34055547e34586a062e2ed07e32 Signed-off-by: garciadeblas --- diff --git a/osm_lcm/lcm.py b/osm_lcm/lcm.py index 8362acc7..880ea922 100644 --- a/osm_lcm/lcm.py +++ b/osm_lcm/lcm.py @@ -648,7 +648,7 @@ class Lcm: vim_config = db_vim.get("config", {}) if command in ("create", "created"): self.logger.debug("Main config: {}".format(self.main_config.to_dict())) - if "credentials" or "credentials_base64" in vim_config: + if "credentials" in vim_config or "credentials_base64" in vim_config: self.logger.info("Vim add cloud credentials") task = asyncio.ensure_future( self.cloud_credentials.add(params, order_id) @@ -665,7 +665,7 @@ class Lcm: return elif command == "delete" or command == "deleted": self.lcm_tasks.cancel(topic, vim_id) - if "credentials" in vim_config: + if "credentials" in vim_config or "credentials_base64" in vim_config: self.logger.info("Vim remove cloud credentials") task = asyncio.ensure_future( self.cloud_credentials.remove(params, order_id) @@ -683,7 +683,7 @@ class Lcm: sys.stdout.flush() return elif command in ("edit", "edited"): - if "credentials" in vim_config: + if "credentials" in vim_config or "credentials_base64" in vim_config: self.logger.info("Vim update cloud credentials") task = asyncio.ensure_future( self.cloud_credentials.edit(params, order_id)