Skip to content
Snippets Groups Projects
Commit c0db9e2e authored by garciadeblas's avatar garciadeblas
Browse files

Call cloud_credentials.add only in VIM operations when VIM account has credentials


Change-Id: I1e3888b9aed2b34055547e34586a062e2ed07e32
Signed-off-by: default avatargarciadeblas <gerardo.garciadeblas@telefonica.com>
parent 8a995a25
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment