[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Add testing section to server descriptor to help debugg...



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv24584/minion/lib/mixminion

Modified Files:
	Common.py Config.py ServerInfo.py 
Log Message:
Add testing section to server descriptor to help debugging

Index: Common.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Common.py,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- Common.py	1 Jul 2003 21:18:31 -0000	1.96
+++ Common.py	7 Jul 2003 16:49:24 -0000	1.97
@@ -1368,7 +1368,7 @@
             return
 
         assert self.fd is None
-        self.fd = os.open(self.filename, os.O_RDWR|os.O_CREAT|os.O_SYNC, 0600)
+        self.fd = os.open(self.filename, os.O_RDWR|os.O_CREAT, 0600)
         try:
             if blocking:
                 fcntl.flock(self.fd, fcntl.LOCK_EX)
@@ -1376,6 +1376,7 @@
                 fcntl.flock(self.fd, fcntl.LOCK_EX|fcntl.LOCK_NB)
             self.count += 1
             os.write(self.fd, contents)
+            os.fsync(self.fd)
         except:
             os.close(self.fd)
             self.fd = None

Index: Config.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Config.py,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- Config.py	1 Jul 2003 21:25:13 -0000	1.51
+++ Config.py	7 Jul 2003 16:49:24 -0000	1.52
@@ -713,6 +713,11 @@
            section was absent, return an empty map."""
         return self._sections[sec]
 
+    def get(self, sec, val="---"):
+        """DOCDOC"""
+        if val == "---": val = {}
+        return self._sections.get(sec, val)
+
     def has_section(self, sec):
         """Return true if this config object allows a section named 'sec'."""
         return self._sections.has_key(sec)

Index: ServerInfo.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ServerInfo.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- ServerInfo.py	9 Jun 2003 00:03:37 -0000	1.49
+++ ServerInfo.py	7 Jul 2003 16:49:24 -0000	1.50
@@ -66,6 +66,7 @@
                      "Packet-Formats": ("ALLOW", None, None),
                      "Software": ("ALLOW", None, None),
                      "Secure-Configuration": ("ALLOW", C._parseBoolean, None),
+                     "Why-Insecure": ("ALLOW", None, None),
                      },
         "Incoming/MMTP" : {
                      "Version": ("REQUIRE", None, None),
@@ -87,7 +88,14 @@
                      },
         "Delivery/SMTP" : {
                      "Version": ("REQUIRE", None, None),
-                     }
+                     },
+        # We never read these values, except to see whether we should
+        # regenerate them.  Depending on these options would violate
+        # the spec.
+        "Testing" : {
+                     "Platform": ("ALLOW", None, None),
+                     "Configuration": ("ALLOW", None, None),
+                     },
         }
 
     def __init__(self, fname=None, string=None, assumeValid=0,