Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two patches #1006

Closed
wants to merge 3 commits into from
Closed
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
11 changes: 11 additions & 0 deletions supervisor/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,10 @@ def get(section, opt, *args, **kwargs):
raise ValueError(
"Cannot set stopasgroup=true and killasgroup=false"
)
#begin of new directive: autodir
#will create these dirs later before create the log file
autodir_str = get(section, 'autodir', '', do_expand=False)
#end of new directive: autodir

for process_num in range(numprocs_start, numprocs + numprocs_start):
expansions = common_expansions
Expand All @@ -908,6 +912,13 @@ def get(section, opt, *args, **kwargs):

logfiles = {}

#begine of new directive: autodir
autodir = list_of_strings(expand(autodir_str, expansions, 'autodir'))
for one_dir in autodir:
if not os.path.exists(one_dir):
os.makedirs(one_dir)
#end of new directive: autodir

for k in ('stdout', 'stderr'):
n = '%s_logfile' % k
lf_val = get(section, n, Automatic)
Expand Down
2 changes: 1 addition & 1 deletion supervisor/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def render(self):
return NOT_DONE_YET
if message is not None:
server_url = form['SERVER_URL']
location = server_url + '?message=%s' % urllib.quote(
location = '?message=%s' % urllib.quote(
message)
response['headers']['Location'] = location

Expand Down