Skip to content

Commit

Permalink
Add parse_infos to options, use it for "parsed file" message
Browse files Browse the repository at this point in the history
This adds a new parse_infos besides parse_warnings, and uses it for the
'Included extra file "%s" during parsing' info.

Fixes #272
  • Loading branch information
blueyed authored and mnaberez committed May 10, 2016
1 parent 8286f01 commit 63a5685
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion supervisor/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ def __init__(self):
self.pidhistory = {}
self.process_group_configs = []
self.parse_warnings = []
self.parse_infos = []
self.signal_receiver = SignalReceiver()

def version(self, dummy):
Expand Down Expand Up @@ -530,6 +531,7 @@ def read_config(self, fp):
# Clear parse warnings, since we may be re-reading the
# config a second time after a reload.
self.parse_warnings = []
self.parse_infos = []

section = self.configroot.supervisord
if not hasattr(fp, 'read'):
Expand Down Expand Up @@ -563,7 +565,7 @@ def read_config(self, fp):
pattern = os.path.join(base, pattern)
filenames = glob.glob(pattern)
if not filenames:
self.parse_warnings.append(
self.parse_infos.append(
'No file matches via include "%s"' % pattern)
continue
for filename in sorted(filenames):
Expand Down
1 change: 1 addition & 0 deletions supervisor/supervisord.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def main(self):
if self.options.first:
rlimit_messages = self.options.set_rlimits()
info_messages.extend(rlimit_messages)
info_messages.extend(self.options.parse_infos)
warn_messages.extend(self.options.parse_warnings)

# this sets the options.logger object
Expand Down
1 change: 1 addition & 0 deletions supervisor/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def __init__(self):
self.openreturn = None
self.readfd_result = ''
self.parse_warnings = []
self.parse_infos = []
self.serverurl = 'http://localhost:9001'
self.changed_directory = False
self.chdir_error = None
Expand Down

0 comments on commit 63a5685

Please sign in to comment.