Преглед на файлове

- Fixed http://www.plope.com/software/collector/215 (bad error
message in supervisorctl when program command not found on PATH).

Chris McDonough преди 17 години
родител
ревизия
a8c1845ce4
променени са 5 файла, в които са добавени 26 реда и са изтрити 10 реда
  1. 3 0
      CHANGES.txt
  2. 9 4
      TODO.txt
  3. 4 0
      src/supervisor/options.py
  4. 8 4
      src/supervisor/process.py
  5. 2 2
      src/supervisor/tests/test_process.py

+ 3 - 0
CHANGES.txt

@@ -225,6 +225,9 @@ Next Release
 
 
   - The 'identifier' command-line argument was not functional.
   - The 'identifier' command-line argument was not functional.
 
 
+  - Fixed http://www.plope.com/software/collector/215 (bad error
+    message in supervisorctl when program command not found on PATH).
+
 3.0a2
 3.0a2
 
 
   - Fixed the README.txt example for defining the supervisor RPC
   - Fixed the README.txt example for defining the supervisor RPC

+ 9 - 4
TODO.txt

@@ -1,5 +1,13 @@
+- Allow supervisorctl's tail -f to work over unix domain socket.
+
+- Allow effective user to switch to a particular group instead of
+  defaulting to the user's primary group:
+  http://www.plope.com/software/collector/233.
+
+- Allow sockchown group only: http://www.plope.com/software/collector/214
+
 - Change license to http://dist.repoze.org/LICENSE.txt (same license,
 - Change license to http://dist.repoze.org/LICENSE.txt (same license,
-  just no mention of Zope).
+  just no "Zope" anywhere).
 
 
 - Implement event max_retry counter that means "after X retries of a
 - Implement event max_retry counter that means "after X retries of a
   rejected event, go into FATAL state".
   rejected event, go into FATAL state".
@@ -16,9 +24,6 @@
    - When we try to kill a process and the os.kill command raises an
    - When we try to kill a process and the os.kill command raises an
      exception (stopProcess)
      exception (stopProcess)
 
 
-- Make *:9001 work for port num (see
-  http://www.plope.com/software/collector/247)
-
 - Generalize eventlistener request/response protocol (wrap OK/FAIL in
 - Generalize eventlistener request/response protocol (wrap OK/FAIL in
   RESULT envelope) so we can use it for more specialized
   RESULT envelope) so we can use it for more specialized
   communications, e.g.:
   communications, e.g.:

+ 4 - 0
src/supervisor/options.py

@@ -1579,6 +1579,8 @@ def _init_signames():
             d[v] = k
             d[v] = k
     _signames = d
     _signames = d
 
 
+# miscellaneous utility functions
+
 def expand(s, expansions, name):
 def expand(s, expansions, name):
     try:
     try:
         return s % expansions
         return s % expansions
@@ -1620,6 +1622,8 @@ def dedupe(L):
         D[thing] = 1
         D[thing] = 1
     return D.keys()
     return D.keys()
 
 
+# exceptions
+
 class ProcessException(Exception):
 class ProcessException(Exception):
     """ Specialized exceptions used when attempting to start a process """
     """ Specialized exceptions used when attempting to start a process """
 
 

+ 8 - 4
src/supervisor/process.py

@@ -124,16 +124,20 @@ class Subprocess:
             
             
         else:
         else:
             path = self.config.options.get_path()
             path = self.config.options.get_path()
-            filename = None
+            found = None
             st = None
             st = None
             for dir in path:
             for dir in path:
-                filename = os.path.join(dir, program)
+                found = os.path.join(dir, program)
                 try:
                 try:
-                    st = self.config.options.stat(filename)
+                    st = self.config.options.stat(found)
                 except OSError:
                 except OSError:
-                    filename = None
+                    pass
                 else:
                 else:
                     break
                     break
+            if st is None:
+                filename = program
+            else:
+                filename = found
 
 
         # check_execv_args will raise a ProcessException if the execv
         # check_execv_args will raise a ProcessException if the execv
         # args are bogus, we break it out into a separate options
         # args are bogus, we break it out into a separate options

+ 2 - 2
src/supervisor/tests/test_process.py

@@ -109,14 +109,14 @@ class SubprocessTests(unittest.TestCase):
         config = DummyPConfig(options, 'notthere', 'notthere')
         config = DummyPConfig(options, 'notthere', 'notthere')
         instance = self._makeOne(config)
         instance = self._makeOne(config)
         args = instance.get_execv_args()
         args = instance.get_execv_args()
-        self.assertEqual(args, (None, ['notthere']))
+        self.assertEqual(args, ('notthere', ['notthere']))
 
 
     def test_get_execv_args_rel_withquotes_missing(self):
     def test_get_execv_args_rel_withquotes_missing(self):
         options = DummyOptions()
         options = DummyOptions()
         config = DummyPConfig(options, 'notthere', 'notthere "an argument"')
         config = DummyPConfig(options, 'notthere', 'notthere "an argument"')
         instance = self._makeOne(config)
         instance = self._makeOne(config)
         args = instance.get_execv_args()
         args = instance.get_execv_args()
-        self.assertEqual(args, (None, ['notthere', 'an argument']))
+        self.assertEqual(args, ('notthere', ['notthere', 'an argument']))
 
 
     def test_get_execv_args_abs(self):
     def test_get_execv_args_abs(self):
         executable = '/bin/sh foo'
         executable = '/bin/sh foo'