Fix deploymentManager profiles not set in conf file 17/9517/1
authorZhang Rong(Jon) <rong.zhang@windriver.com>
Tue, 8 Nov 2022 01:41:02 +0000 (09:41 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Tue, 8 Nov 2022 08:25:54 +0000 (08:25 +0000)
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
Change-Id: Ice973c45bb86a102b9fe90661512cdc2c4b06fb9
(cherry picked from commit b163536727699c1ec3b0d12d8132c62c58523ab4)

o2common/config/config.py

index a2907c4..690f4e9 100644 (file)
@@ -348,9 +348,12 @@ def get_auth_provider():
 
 def get_dms_support_profiles():
     profiles = config.conf.API.DMS_SUPPORT_PROFILES
-    profiles = profiles.replace("'", "").replace(
-        '"', "").replace('[', "").replace(']', "")
-    profiles = profiles.split(',')
+    if profiles is None or profiles == '':
+        profiles = []
+    elif "[" in profiles and "]" in profiles:
+        profiles = profiles.replace("'", "").replace(
+            '"', "").replace('[', "").replace(']', "")
+        profiles = profiles.split(',')
     if 'native_k8sapi' not in profiles:
         profiles.append('native_k8sapi')
     return profiles