Skip to content

Allow supervisord environment vars to have "="#572

Merged
ddollar merged 1 commit into
ddollar:masterfrom
stephenyeargin:supervisord-environment-quotes
Apr 23, 2016
Merged

Allow supervisord environment vars to have "="#572
ddollar merged 1 commit into
ddollar:masterfrom
stephenyeargin:supervisord-environment-quotes

Conversation

@stephenyeargin

Copy link
Copy Markdown
Contributor

Prior to this PR, an environment variable configured for use with Foreman could not contain a ?, = or & (common in URLs) if the target configuration was set to SupervisorD. This PR cleans up the output from Shellwords.escape in order to be ready for use in a app*.conf file. I've updated the tests to cover this particular issue.


From the documentation for Shellwords

Note that a resulted string should be used unquoted and is not intended for use in double quotes nor in single quotes.


From the documentation for SupervisorD

A list of key/value pairs in the form KEY="val",KEY2="val2" that will be placed in the child process’ environment. The environment string may contain Python string expressions that will be evaluated against a dictionary containing group_name, host_node_name, process_num, program_name, and here (the directory of the supervisord config file). Values containing non-alphanumeric characters should be quoted (e.g. KEY="val:123",KEY2="val,456"). Otherwise, quoting the values is optional but recommended. Note that the subprocess will inherit the environment variables of the shell used to start “supervisord” except for the ones overridden here.

Fixes #571
Fixes #519

/cc @inbeom, @ddollar

Prior to this PR, an environment variable configured for use with Foreman could not contain a `?`, `=` or `&` (common in URLs) if the target configuration was set to SupervisorD. This PR cleans up the output from `Shellwords.escape` in order to be ready for use in a `app*.conf` file. I've updated the tests to cover this particular issue.

Fixes #571
Fixes #519

/cc @inbeom, @ddollar
@stephenyeargin

Copy link
Copy Markdown
Contributor Author

In browsing through branches, I see this as another possible approach.

https://github.com/doitian/foreman/commit/36f0ae4e57e962318e0b4ebb646622f7cec86253

@ddollar
ddollar merged commit 812f38e into ddollar:master Apr 23, 2016
@ddollar

ddollar commented Apr 23, 2016

Copy link
Copy Markdown
Owner

Thanks!

@stephenyeargin
stephenyeargin deleted the supervisord-environment-quotes branch April 30, 2016 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants