[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.44-827-g219614b

Andreas Beckmann debian at abeckmann.de
Wed Jun 20 23:09:59 UTC 2012


The following commit has been merged in the develop branch:
commit af6b4cd5e508ebbbf0c7c2928fa3742e2437657b
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Wed Jun 20 20:39:33 2012 +0200

    p-m: always chdir(master_directory)
    
    do not rely on being run from there
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index d4f4ed8..3284b2a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -131,6 +131,7 @@ piuparts (0.45) UNRELEASED; urgency=low
   * piuparts-master.py:
     - Remove known_circular_depends handling.
     - Reduce logfile verboseness: do not include received logs.
+    - Always chdir to master_directory, do not rely on being run from there.
   * piuparts-slave.py:
     - Randomize waiting time (between 60 and 180 seconds) if master is busy.
     - Sleep until the next section can be tried, but at least 1 minute.
diff --git a/piuparts-master.py b/piuparts-master.py
index de745b9..330629d 100644
--- a/piuparts-master.py
+++ b/piuparts-master.py
@@ -209,9 +209,11 @@ def main():
         setup_logging(logging.DEBUG, config["log-file"])
 
         if not os.path.exists(os.path.join(master_directory, section)):
-          os.makedirs(os.path.join(master_directory, section))
+            os.makedirs(os.path.join(master_directory, section))
 
-        lock = open(os.path.join(master_directory, section, "master.lock"), "we")
+        os.chdir(master_directory)
+
+        lock = open(os.path.join(section, "master.lock"), "we")
         try:
             fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
         except IOError:

-- 
piuparts git repository



More information about the Piuparts-commits mailing list