From: jingui.ren Date: Fri, 23 Mar 2018 02:46:13 +0000 (+0800) Subject: Fix bugs the instance of ConfigMgr class can not access get_optional_item method X-Git-Tag: submit/devel/20190730.074523~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0b7f6ed6763c5b1c155e342211d1b421a820405;p=tools%2Fgbs.git Fix bugs the instance of ConfigMgr class can not access get_optional_item method Change-Id: I1b63b6240f34e34dc6d29b1af6ed9ff4ef2e84c9 Signed-off-by: jingui.ren --- diff --git a/gitbuildsys/conf.py b/gitbuildsys/conf.py index 5c01f28..798dc86 100644 --- a/gitbuildsys/conf.py +++ b/gitbuildsys/conf.py @@ -407,6 +407,13 @@ url = http://download.tizen.org/releases/daily/trunk/ivi/latest/ return True return False + def get_optional_item(self, section, option, default=None): + '''return default if section.option does not exist''' + try: + return self.get(option, section) + except errors.ConfigError: + return default + def get(self, opt, section='general'): 'get item value. return plain text of password if item is passwd' @@ -636,13 +643,6 @@ class BizConfigManager(ConfigMgr): 'Please check %s, a new profile oriented style of config ' ' which was converted from your current settings.' % fname) - def get_optional_item(self, section, option, default=None): - '''return default if section.option does not exist''' - try: - return self.get(option, section) - except errors.ConfigError: - return default - def _get_url_options(self, section_id): '''get url/user/passwd from a section''' url = os.path.expanduser(self._interpolate(self.get('url', section_id)))