浏览代码

Revert "Allow an options instance to be passed to main(). Closes #111"

This reverts commit 049dbef428eaf16bde57bca9e1421ff28c36a1ba.
Mike Naberezny 11 年之前
父节点
当前提交
a85da1d9d7
共有 3 个文件被更改,包括 2 次插入33 次删除
  1. 0 4
      CHANGES.txt
  2. 2 3
      supervisor/supervisord.py
  3. 0 26
      supervisor/tests/test_supervisord.py

+ 0 - 4
CHANGES.txt

@@ -18,10 +18,6 @@
 - Removed ``setuptools`` from the ``requires`` list in ``setup.py`` because
   it caused installation issues on some systems.
 
-- The ``main()`` function of the ``supervisord`` module now allows an
-  ``options`` instance to be passed in.  This is consistent with the
-  ``main()`` function of ``supervisorctl``, which already allowed this.
-
 3.0 (2013-07-30)
 ----------------
 

+ 2 - 3
supervisor/supervisord.py

@@ -344,13 +344,12 @@ def profile(cmd, globals, locals, sort_order, callers):
 
 
 # Main program
-def main(args=None, options=None, test=False):
+def main(args=None, test=False):
     assert os.name == "posix", "This code makes Unix-specific assumptions"
     # if we hup, restart by making a new Supervisor()
     first = True
     while 1:
-        if options is None:
-            options = ServerOptions()
+        options = ServerOptions()
         options.realize(args, doc=__doc__)
         options.first = first
         options.test = test

+ 0 - 26
supervisor/tests/test_supervisord.py

@@ -35,32 +35,6 @@ class EntryPointTests(unittest.TestCase):
         output = new_stdout.getvalue()
         self.assertTrue(output.find('supervisord started') != 1, output)
 
-    def test_main_allows_injection_of_options_instance(self):
-        from supervisor.supervisord import main
-        from supervisor.options import ServerOptions
-        conf = os.path.join(
-            os.path.abspath(os.path.dirname(__file__)), 'fixtures',
-            'donothing.conf')
-        import StringIO
-        new_stdout = StringIO.StringIO()
-        old_stdout = sys.stdout
-
-        options = ServerOptions()
-        self.assertFalse(hasattr(options, "args"))
-
-        try:
-            tempdir = tempfile.mkdtemp()
-            log = os.path.join(tempdir, 'log')
-            pid = os.path.join(tempdir, 'pid')
-            sys.stdout = new_stdout
-            main(args=['-c', conf, '-l', log, '-j', pid, '-n'],
-                 options=options, test=True)
-        finally:
-            sys.stdout = old_stdout
-            shutil.rmtree(tempdir)
-
-        self.assertTrue(hasattr(options, "args"))
-
     if sys.version_info[:2] >= (2, 4):
         def test_main_profile(self):
             from supervisor.supervisord import main