conf: error handling if no no section headers
authorZhang Qiang <qiang.z.zhang@intel.com>
Fri, 3 Aug 2012 05:48:48 +0000 (13:48 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Fri, 3 Aug 2012 05:48:48 +0000 (13:48 +0800)
gitbuildsys/conf.py

index 3d9487d..8ce768b 100644 (file)
@@ -293,7 +293,10 @@ distconf = $build__distconf
         self.replaced_keys = defaultdict(list)
 
         if fpaths:
-            self.cfgparser.read(fpaths)
+            try:
+                self.cfgparser.read(fpaths)
+            except MissingSectionHeaderError, err:
+                raise errors.ConfigError('config file error:%s' % err)
             self._check_passwd()
 
     def _lookfor_confs(self):