[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.51

Andreas Beckmann anbe at debian.org
Wed May 15 10:09:47 UTC 2013


The following commit has been merged in the master branch:
commit 3763009cf1456baf36fe43e7eef6002a348216d0
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Apr 7 02:04:29 2013 +0200

    p-m: gracefully handle missing sections
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/piuparts-master-backend.py b/piuparts-master-backend.py
index 371ba9d..ce98053 100644
--- a/piuparts-master-backend.py
+++ b/piuparts-master-backend.py
@@ -35,6 +35,7 @@ import random
 
 import piupartslib
 from piupartslib.packagesdb import LogfileExists
+from piupartslib.conf import MissingSection
 
 
 CONFIG_FILE = "/etc/piuparts/piuparts.conf"
@@ -153,7 +154,11 @@ class Master(Protocol):
         self._package_databases = None
 
         config = Config(section=section, defaults_section="global")
-        config.read(CONFIG_FILE)
+        try:
+            config.read(CONFIG_FILE)
+        except MissingSection:
+            print 'error'
+            sys.exit(0)
 
         if not os.path.exists(section):
             os.makedirs(section)

-- 
piuparts git repository



More information about the Piuparts-commits mailing list