fix VIM edit problem with SDN controller 09/6309/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 28 Jun 2018 13:26:54 +0000 (15:26 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 28 Jun 2018 13:28:17 +0000 (15:28 +0200)
Change-Id: I3cf6705ff846d0d22a077f20d96abf860f70e000
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_lcm/lcm.py

index c679add..83efbca 100644 (file)
@@ -283,8 +283,9 @@ class Lcm:
                         vim_account_RO[k] = vim_content[k]
                 if "vim_user" in vim_content:
                     vim_content["vim_username"] = vim_content["vim_user"]
-                if vim_account_RO:
-                    await RO.edit("vim_account", RO_vim_id, descriptor=vim_account_RO)
+                # vim_account must be edited always even if empty in order to ensure changes are translated to RO
+                # vim_thread. RO will remove and relaunch a new thread for this vim_account
+                await RO.edit("vim_account", RO_vim_id, descriptor=vim_account_RO)
                 db_vim["_admin"]["operationalState"] = "ENABLED"
                 self.update_db("vim_accounts", vim_id, db_vim)