[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] backport to python2.0



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.seul.org:/tmp/cvs-serv18646/lib/mixminion

Modified Files:
	Common.py Config.py ServerMain.py 
Log Message:
backport to python2.0

Index: Common.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Common.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- Common.py	4 Sep 2002 00:38:15 -0000	1.21
+++ Common.py	16 Sep 2002 15:30:02 -0000	1.22
@@ -15,6 +15,7 @@
 import time
 import stat
 import traceback
+import calendar
 from types import StringType
 
 class MixError(Exception):
@@ -129,7 +130,7 @@
 
     if cmd is None:
         if os.path.exists("/usr/bin/shred"):
-            cmd, opts = "/usr/bin/shred/", ["-uz"]
+            cmd, opts = "/usr/bin/shred", ["-uz"]
         else:
             getLog().warn("Files will not be securely deleted.")
             cmd, opts = None, None
@@ -170,7 +171,8 @@
         mode = os.P_NOWAIT
 
     if _SHRED_CMD:
-        return os.spawnl(mode, _SHRED_CMD, _SHRED_CMD, *(_SHRED_OPTS+fnames))
+        code = os.spawnl(mode, _SHRED_CMD, _SHRED_CMD, *(_SHRED_OPTS+fnames))
+	return code
     else:
         for f in fnames:
             os.unlink(f)
@@ -369,13 +371,15 @@
     
     # we set the DST flag to zero so that subtracting time.timezone always
     # gives us gmt.
-    return time.mktime((yyyy,MM,dd,hh,mm,ss,0,0,0))-time.timezone
+    #return time.mktime((yyyy,MM,dd,hh,mm,ss,0,0,0))-time.timezone
+
+    return calendar.timegm((yyyy,MM,dd,hh,mm,ss,0,0,0))
 
 def previousMidnight(when):
     """Given a time_t 'when', return the greatest time_t <= when that falls
        on midnight, GMT."""
     yyyy,MM,dd = time.gmtime(when)[0:3]
-    return mkgmtime(yyyy,MM,dd,0,0,0)
+    return calendar.timegm((yyyy,MM,dd,0,0,0,0,0,0))
 
 #----------------------------------------------------------------------
 # Signal handling

Index: Config.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Config.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Config.py	10 Sep 2002 20:06:25 -0000	1.16
+++ Config.py	16 Sep 2002 15:30:02 -0000	1.17
@@ -566,7 +566,7 @@
                 raise ConfigError("Section [%s] not found." %secName)
             elif not self_sections.has_key(secName):
                 self_sections[secName] = {}
-                self_sectionEntries[secName] = {}
+                self_sectionEntries[secName] = []
                 
         if not self.assumeValid:
             # Call our validation hook.

Index: ServerMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ServerMain.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ServerMain.py	10 Sep 2002 14:45:31 -0000	1.9
+++ ServerMain.py	16 Sep 2002 15:30:02 -0000	1.10
@@ -216,7 +216,7 @@
 	    if when < self.nextKeyRotation:
 		return self.liveKey
 
-	idx = bisect.bisect_right(self.keyIntervals, (when, None, None))-1
+	idx = bisect.bisect(self.keyIntervals, (when, None, None))-1
 	k = self.keyIntervals[idx]
 	if w is None:
 	    self.liveKey = k