From c0db9e2e0c3dbfe73128de0b05ad80146bca5238 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Thu, 3 Apr 2025 13:43:57 +0200 Subject: [PATCH] Call cloud_credentials.add only in VIM operations when VIM account has credentials Change-Id: I1e3888b9aed2b34055547e34586a062e2ed07e32 Signed-off-by: garciadeblas --- osm_lcm/lcm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.25.1