Ver código fonte

Add ``/etc/supervisor/supervisord.conf`` to the search paths.
Closes #414

Mike Naberezny 9 anos atrás
pai
commit
3ed820a8c9
4 arquivos alterados com 21 adições e 10 exclusões
  1. 6 0
      CHANGES.txt
  2. 5 5
      docs/configuration.rst
  3. 3 1
      supervisor/options.py
  4. 7 4
      supervisor/tests/test_options.py

+ 6 - 0
CHANGES.txt

@@ -31,6 +31,12 @@
 - Files included via the ``[include]`` section are now logged at the ``INFO``
   level instead of ``WARN``.  Patch by Daniel Hahler.
 
+- ``/etc/supervisor/supervisord.conf`` has been added to the config file search
+  paths.  Many versions of Supervisor packaged for Debian and Ubuntu have
+  included a patch that added this path.  This difference was reported in a
+  number of tickets as a source of confusion and upgrade difficulties, so the
+  path has been added.  Patch by Kelvin Wong.
+
 3.2.3 (2016-03-19)
 ------------------
 

+ 5 - 5
docs/configuration.rst

@@ -16,17 +16,17 @@ file it finds.
 
 #. :file:`/etc/supervisord.conf`
 
+#. :file:`/etc/supervisor/supervisord.conf` (since Supervisor 3.3.0)
+
 #. :file:`../etc/supervisord.conf` (Relative to the executable)
 
 #. :file:`../supervisord.conf` (Relative to the executable)
 
 .. note::
 
-  Some distributions have packaged Supervisor with their own
-  customizations.  These modified versions of Supervisor may load the
-  configuration file from locations other than those described here.
-  Notably, Ubuntu packages have been found that use
-  ``/etc/supervisor/supervisord.conf``.
+  Many versions of Supervisor packaged for Debian and Ubuntu included a patch
+  that added ``/etc/supervisor/supervisord.conf`` to the search paths.  The
+  first PyPI package of Supervisor to include it was Supervisor 3.3.0.
 
 File Format
 -----------

+ 3 - 1
supervisor/options.py

@@ -108,7 +108,9 @@ class Options:
                        os.path.join(here, 'supervisord.conf'),
                        'supervisord.conf',
                        'etc/supervisord.conf',
-                       '/etc/supervisord.conf']
+                       '/etc/supervisord.conf',
+                       '/etc/supervisor/supervisord.conf',
+                       ]
         self.searchpaths = searchpaths
 
         self.environ_expansions = {}

+ 7 - 4
supervisor/tests/test_options.py

@@ -161,10 +161,13 @@ class OptionTests(unittest.TestCase):
 
     def test_searchpaths(self):
         options = self._makeOptions()
-        self.assertEqual(len(options.searchpaths), 5)
-        self.assertTrue('supervisord.conf' in options.searchpaths)
-        self.assertTrue('etc/supervisord.conf' in options.searchpaths)
-        self.assertTrue('/etc/supervisord.conf' in options.searchpaths)
+        self.assertEqual(len(options.searchpaths), 6)
+        self.assertEqual(options.searchpaths[-4:], [
+            'supervisord.conf',
+            'etc/supervisord.conf',
+            '/etc/supervisord.conf',
+            '/etc/supervisor/supervisord.conf',
+            ])
 
     def test_options_and_args_order(self):
         # Only config file exists