Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion supervisor/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def get(opt, default, **kwargs):
section.nocleanup = boolean(get('nocleanup', 'false'))
section.strip_ansi = boolean(get('strip_ansi', 'false'))

environ_str = get('environment', '')
environ_str = get('environment', '', do_expand=False)
environ_str = expand(environ_str, expansions, 'environment')
section.environment = dict_of_key_value_pairs(environ_str)

Expand Down
12 changes: 12 additions & 0 deletions supervisor/tests/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -3409,6 +3409,18 @@ def test_daemonize_notifies_poller_before_and_after_fork(self):
instance.poller.before_daemonize.assert_called_once_with()
instance.poller.after_daemonize.assert_called_once_with()

def test_options_environment_of_supervisord_with_escaped_chars(self):
text = lstrip("""
[supervisord]
environment=VAR_WITH_P="some_value_%%_end"
""")

instance = self._makeOne()
instance.configfile = StringIO(text)
instance.realize(args=[])
options = instance.configroot.supervisord
self.assertEqual(options.environment, dict(VAR_WITH_P="some_value_%_end"))

class ProcessConfigTests(unittest.TestCase):
def _getTargetClass(self):
from supervisor.options import ProcessConfig
Expand Down