[Supervisor-checkins] r939 - in supervisor/trunk: . src/supervisor src/supervisor/tests
Mike Naberezny
mike at maintainable.com
Sun Mar 28 14:35:12 EDT 2010
Author: Mike Naberezny <mike at maintainable.com>
Date: Sun Mar 28 14:35:12 2010
New Revision: 939
Log:
Parsing environment= now allows characters commonly found in paths to be in an unquoted value.
Modified:
supervisor/trunk/CHANGES.txt
supervisor/trunk/src/supervisor/datatypes.py
supervisor/trunk/src/supervisor/tests/test_datatypes.py
Modified: supervisor/trunk/CHANGES.txt
==============================================================================
--- supervisor/trunk/CHANGES.txt (original)
+++ supervisor/trunk/CHANGES.txt Sun Mar 28 14:35:12 2010
@@ -1,11 +1,26 @@
Next release
+ - When parsing "environment=" in the config file, changes introduced in
+ 3.0a8 prevented Supervisor from parsing some characters commonly
+ found in paths unless quoting was used as in this example:
+
+ environment=HOME='/home/auser'
+
+ Supervisor once again allows the above line to be written as:
+
+ environment=HOME=/home/auser
+
+ Alphanumeric characters, "_", "/", ".", "+", "-", "(", and ")" can all be
+ used as a value without quoting. If any other characters are neeed in the
+ value, please quote it as in the first example above. Thanks to Paul
+ Heideman for reporting this issue.
+
- Supervisor will now look for its config file in locations relative to the
executable path, allowing it to be used more easily in virtual
environments. If sys.argv[0] is '/path/to/venv/bin/supervisorctl',
supervisor will now look for it's config file in
'/path/to/venv/etc/supervisord.conf' and '/path/to/venv/supervisord.conf'
- in addition to the other standard locations.
+ in addition to the other standard locations. Patch by Chris Rossi.
3.0a8 (2010-01-20)
Modified: supervisor/trunk/src/supervisor/datatypes.py
==============================================================================
--- supervisor/trunk/src/supervisor/datatypes.py (original)
+++ supervisor/trunk/src/supervisor/datatypes.py Sun Mar 28 14:35:12 2010
@@ -84,7 +84,10 @@
""" parse KEY=val,KEY2=val2 into {'KEY':'val', 'KEY2':'val2'}
Quotes can be used to allow commas in the value
"""
- tokens = list(shlex.shlex(arg))
+ lexer = shlex.shlex(arg)
+ lexer.wordchars += '/.+-()'
+
+ tokens = list(lexer)
tokens_len = len(tokens)
D = {}
Modified: supervisor/trunk/src/supervisor/tests/test_datatypes.py
==============================================================================
--- supervisor/trunk/src/supervisor/tests/test_datatypes.py (original)
+++ supervisor/trunk/src/supervisor/tests/test_datatypes.py Sun Mar 28 14:35:12 2010
@@ -115,6 +115,12 @@
expected = {'foo': 'bar,baz', 'baz': 'q,ux'}
self.assertEqual(actual, expected)
+ def test_dict_of_key_value_pairs_handles_unquoted_non_alphanum(self):
+ actual = datatypes.dict_of_key_value_pairs(
+ 'HOME=/home/auser,FOO=/.foo+(1.2)-_/')
+ expected = {'HOME': '/home/auser', 'FOO': '/.foo+(1.2)-_/'}
+ self.assertEqual(actual, expected)
+
def test_dict_of_key_value_pairs_allows_trailing_comma(self):
actual = datatypes.dict_of_key_value_pairs('foo=bar,')
expected = {'foo': 'bar'}
More information about the Supervisor-checkins
mailing list