From c074758add133192a47d6af72966594194e482d1 Mon Sep 17 00:00:00 2001 From: Haibin Huang Date: Mon, 14 May 2018 16:38:33 +0800 Subject: Fix hpa registration cloud_extra_info format Change-Id: Ie597bc2b93a7538138558a38b33e1014c2364687 Issue-ID: MULTICLOUD-206 Signed-off-by: Haibin Huang --- ocata/ocata/registration/views/registration.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ocata') diff --git a/ocata/ocata/registration/views/registration.py b/ocata/ocata/registration/views/registration.py index 4d954cb1..bb898995 100644 --- a/ocata/ocata/registration/views/registration.py +++ b/ocata/ocata/registration/views/registration.py @@ -318,6 +318,13 @@ class Registry(newton_registration.Registry): feature_uuid = uuid.uuid4() cloud_extra_info_str = viminfo.get('cloud_extra_info') + if not isinstance(cloud_extra_info_str, dict): + try: + cloud_extra_info_str = json.loads(cloud_extra_info_str) + except Exception as ex: + logger.error("Can not convert cloud extra info %s %s" % ( + str(ex), cloud_extra_info_str)) + return {} if cloud_extra_info_str : cloud_dpdk_info = cloud_extra_info_str.get("ovsDpdk") if cloud_dpdk_info : -- cgit 1.2.3-korg