summaryrefslogtreecommitdiffstats
path: root/windriver/titanium_cloud/vesagent/vesagent_ctrl.py
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2018-05-15 08:37:29 +0000
committerBin Yang <bin.yang@windriver.com>2018-05-15 08:37:29 +0000
commitcaa098049b68993b6cf7965ff14114f47c7aaad5 (patch)
treea0ef7f1f7844c23b9da6e847aa1cff66c575634f /windriver/titanium_cloud/vesagent/vesagent_ctrl.py
parent6bda6e9b753e9d900aca898c438bc8b1e7d006e0 (diff)
pass backlogs via cache and verify that
Change-Id: I5ea05e29290a23c290d3e1deb7ef637b06e7c6b7 Issue-ID: MULTICLOUD-230 Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'windriver/titanium_cloud/vesagent/vesagent_ctrl.py')
-rw-r--r--windriver/titanium_cloud/vesagent/vesagent_ctrl.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/windriver/titanium_cloud/vesagent/vesagent_ctrl.py b/windriver/titanium_cloud/vesagent/vesagent_ctrl.py
index 0cc2e9f5..a531a61a 100644
--- a/windriver/titanium_cloud/vesagent/vesagent_ctrl.py
+++ b/windriver/titanium_cloud/vesagent/vesagent_ctrl.py
@@ -258,6 +258,21 @@ class VesAgentCtrl(APIView):
# cache forever
cache.set("VesAgentBacklogs.config.%s" % vimid, VesAgentBacklogsConfigStr, None)
+ # update list of vimid for vesagent
+ # get the whole list of backlog
+ VesAgentBacklogsVimListStr = cache.get("VesAgentBacklogs.vimlist")
+ VesAgentBacklogsVimList = [vimid]
+ if VesAgentBacklogsVimListStr is not None:
+ VesAgentBacklogsVimList = json.loads(VesAgentBacklogsVimListStr)
+ VesAgentBacklogsVimList = [v for v in VesAgentBacklogsVimList if v != vimid]
+ VesAgentBacklogsVimList = self.vimid_
+ VesAgentBacklogsVimList.append(vimid)
+
+ logger.info("VesAgentBacklogs.vimlist is %s" % VesAgentBacklogsVimList)
+
+ #cache forever
+ cache.set("VesAgentBacklogs.vimlist", json.dumps(VesAgentBacklogsVimList), None)
+
# notify schduler
scheduleBacklogs.delay(vimid)
except Exception as e: