From 24f743142abe736e88fe7f4bf69511d2de823ab6 Mon Sep 17 00:00:00 2001 From: Bin Yang Date: Tue, 27 Aug 2019 10:26:21 +0000 Subject: Add get api v1 to registration API Fix error of cache set with object Change-Id: Ie397fefa4e19be2a7257ecd5adaa8dd63472b355 Issue-ID: MULTICLOUD-792 Signed-off-by: Bin Yang --- share/common/msapi/helper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'share/common') diff --git a/share/common/msapi/helper.py b/share/common/msapi/helper.py index c151d253..50ef3407 100644 --- a/share/common/msapi/helper.py +++ b/share/common/msapi/helper.py @@ -354,6 +354,7 @@ class MultiCloudThreadHelper(object): "id": item["id"], "status": item["status"] } + cache_item_for_query_str = json.dumps(cache_item_for_query) if item.get("repeat", 0) == 0: self.owner.expire(backlog_id) # keep only the id and status @@ -361,7 +362,7 @@ class MultiCloudThreadHelper(object): #update cache try: - cache.set(self.owner.cache_expired_prefix + cache_item_for_query["id"], cache_item_for_query, 3600*24) + cache.set(self.owner.cache_expired_prefix + cache_item_for_query["id"], cache_item_for_query_str, 3600*24) cache.delete(self.owner.cache_prefix + cache_item_for_query["id"]) except Exception as e: logger.error(str(e)) @@ -369,7 +370,7 @@ class MultiCloudThreadHelper(object): item["timestamp"] = now #update cache try: - cache.set(self.owner.cache_prefix + cache_item_for_query["id"], cache_item_for_query, 3600*24) + cache.set(self.owner.cache_prefix + cache_item_for_query["id"], cache_item_for_query_str, 3600*24) except Exception as e: logger.error(str(e)) pass -- cgit 1.2.3-korg