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 Supervisor#272
  • Loading branch information
blueyed committed Jan 20, 2014
1 parent 8c66137 commit bf699a7
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 @@ -432,6 +432,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 @@ -517,6 +518,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 @@ -545,7 +547,7 @@ def read_config(self, fp):
for pattern in files:
pattern = os.path.join(base, pattern)
for filename in glob.glob(pattern):
self.parse_warnings.append(
self.parse_infos.append(
'Included extra file "%s" during parsing' % filename)
try:
parser.read(filename)
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 bf699a7

Please sign in to comment.