[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.50-90-g8664feb

Andreas Beckmann anbe at debian.org
Sat Apr 13 14:09:38 UTC 2013


The following commit has been merged in the develop branch:
commit 90247f17b0c5ceb294a30225ce149eeae880a12c
Author: Andreas Beckmann <anbe at debian.org>
Date:   Mon Apr 8 01:48:58 2013 +0200

    p-m: don't take a section argument from the command line
    
    obsoleted by the new "section" command
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/piuparts-master-backend.py b/piuparts-master-backend.py
index de62dca..ac0dd10 100644
--- a/piuparts-master-backend.py
+++ b/piuparts-master-backend.py
@@ -131,7 +131,7 @@ class Master(Protocol):
         "successfully-tested",
     )
 
-    def __init__(self, input, output, section):
+    def __init__(self, input, output):
         Protocol.__init__(self, input, output)
         self._commands = {
             "section": self._switch_section,
@@ -146,7 +146,6 @@ class Master(Protocol):
         }
         self._section = None
         self._lock = None
-        self._init_section(section)
         self._writeline("hello")
 
     def _init_section(self, section):
@@ -369,27 +368,21 @@ class Master(Protocol):
 
 def main():
     setup_logging(logging.INFO, None)
-    # piuparts-master is always called by the slave with a section as argument
-    if len(sys.argv) == 2:
+    if True:
         global_config = Config(section="global")
         global_config.read(CONFIG_FILE)
         if global_config["proxy"]:
             os.environ["http_proxy"] = global_config["proxy"]
         master_directory = global_config["master-directory"]
 
-        section = sys.argv[1]
-
         if not os.path.exists(master_directory):
             os.makedirs(master_directory)
 
         os.chdir(master_directory)
 
-        m = Master(sys.stdin, sys.stdout, section)
+        m = Master(sys.stdin, sys.stdout)
         while m.do_transaction():
             pass
-    else:
-        print 'piuparts-master needs to be called with a valid sectionname as argument, exiting...'
-        sys.exit(1)
 
 if __name__ == "__main__":
     main()
diff --git a/piuparts-master.in b/piuparts-master.in
index 1c24285..bd1c4ea 100755
--- a/piuparts-master.in
+++ b/piuparts-master.in
@@ -35,12 +35,6 @@ LOGFILE="$LOGFILE.$$"
 
 cd "$MASTER"
 
-section="$1"
-if [ -z "$section" ]; then
-	echo "FAIL: no section supplied"
-	exit 1
-fi
-
 trap "test -s ${LOGFILE} || rm -f ${LOGFILE}" EXIT
 
- at sharedir@/piuparts/piuparts-master-backend "$section" 2> "$LOGFILE"
+ at sharedir@/piuparts/piuparts-master-backend 2> "$LOGFILE"

-- 
piuparts git repository



More information about the Piuparts-commits mailing list