From 35a0c5c062c475972a9328393c4b32ee8b766da7 Mon Sep 17 00:00:00 2001 From: seaurching Date: Tue, 5 Dec 2023 17:44:17 +0800 Subject: [PATCH] use re to fix config domain contains quotations --- kscore/domain.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kscore/domain.py b/kscore/domain.py index 7d59fc0..f1f230d 100644 --- a/kscore/domain.py +++ b/kscore/domain.py @@ -13,7 +13,7 @@ # language governing permissions and limitations under the License. import os import logging - +import re import kscore.configloader from kscore.exceptions import ConfigNotFound, PartialCredentialsError @@ -64,6 +64,8 @@ def load(self): continue if 'Domain' in config: domain = config['Domain'] + api_domain = re.sub(r'[\'\"](.*?)[\'\"]', r'\1', str(domain["ks_domain"])) + domain.update({'ks_domain': api_domain}) if self.KS_DOMAIN in domain: logger.info("Found Domain in ksc config file: %s", filename)