My supervisor configuration file
environment=USER=%(ENV_FLOWER_USER_NAME),PASS=%(ENV_FLOWER_PASSWORD)
command=/usr/local/opt/python/bin/flower --basic_auth=%(ENV_USER}:%(ENV_PASS)
When I start supervisord, I receive the following error
Restarting supervisor: Error: Format string 'USER=%(ENV_FLOWER_USER_NAME),PASS=%(ENV_FLOWER_PASSWORD)' for 'environment' is badly formatted
Any ideas?
Environment Variables¶. Environment variables that are present in the environment at the time that supervisord is started can be used in the configuration file using the Python string expression syntax %(ENV_X)s: In the example above, the expression %(ENV_LOGLEVEL)s would be expanded to the value of the environment variable LOGLEVEL.
Note: Any user environment variable can be set or modified in a regular Command Prompt window, but changing system-wide environment variables requires an elevated Command Prompt. There are two distinct ways to set environment variables. The first uses the set command.
First, you need to launch Command Prompt, or CMD, as an administrator. Click Start, type “cmd” into the search box, and then click “Run as Administrator.” Note: Any user environment variable can be set or modified in a regular Command Prompt window, but changing system-wide environment variables requires an elevated Command Prompt.
There are two distinct ways to set environment variables. The first uses the set command. Set defines an environment variable exclusively within the process in which it has been defined — in other words, the variable only works in the window you have open or the script that contains it.
Looks like you are missing the leading s
in formatting environment variable name. Here is sample config file.
You should use
environment=USER=%(ENV_FLOWER_USER_NAME)s,PASS=%(ENV_FLOWER_PASSWORD)s
command=/usr/local/opt/python/bin/flower --basic_auth=%(ENV_USER)s:%(ENV_PASS)s
For readability
environment=
USER=%(ENV_FLOWER_USER_NAME)s,
PASS=%(ENV_FLOWER_PASSWORD)s
command=/usr/local/opt/python/bin/flower
--basic_auth=%(ENV_USER)s:%(ENV_PASS)s
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With