From: Zhang Qiang Date: Fri, 8 Jun 2012 04:39:09 +0000 (+0800) Subject: allow decode empty passwd in conf to avoid exceptions X-Git-Tag: 0.7~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c3232c2db28f1b3c7aa718bcfb19dfa7653d9a2;p=tools%2Fgbs.git allow decode empty passwd in conf to avoid exceptions only check password if config file exist --- diff --git a/gitbuildsys/conf.py b/gitbuildsys/conf.py index f470539..15a5a66 100644 --- a/gitbuildsys/conf.py +++ b/gitbuildsys/conf.py @@ -292,10 +292,11 @@ commit_email = $import__commit_email if not self._new_conf(): msger.error('No config file available') - self.cfgparser.read(fpaths) - self.replaced_keys = defaultdict(list) - self._check_passwd() + + if fpaths: + self.cfgparser.read(fpaths) + self._check_passwd() def _lookfor_confs(self): """Look for available config files following the order: @@ -357,10 +358,9 @@ commit_email = $import__commit_email for key in self.options(sec): if key.endswith('passwd'): plainpass = self._get(key, sec) - if not plainpass: - # None or '' + if plainpass is None: continue - + # empty string password is acceptable here self.replaced_keys[sec].append(key) self.set(key, base64.b64encode(plainpass.encode('bz2')),