Merge pull request #18046 from s0undt3ch/issues/17760

Instantiate a logger in order to log.
This commit is contained in:
Nicole Thomas 2014-11-13 09:57:42 -07:00
commit 886ea165c9
3 changed files with 4 additions and 13 deletions

View file

@ -66,9 +66,6 @@ disable=W0142,
# (visual studio) and html
output-format=text
# Include message's id in output
include-ids=yes
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".

View file

@ -111,12 +111,6 @@ disable=R,
[REPORTS]
# Include message's id in output
include-ids=yes
# Include symbolic ids of messages in output
symbols=no
# Tells whether to display a full report or only the messages
reports=no

View file

@ -152,7 +152,7 @@ class OptionParser(optparse.OptionParser):
try:
process_option_func()
except Exception as err:
logging.getLogger(__name__).exception(err)
logging.getlogger(__name__).exception(err)
self.error(
'Error while processing {0}: {1}'.format(
process_option_func, traceback.format_exc(err)
@ -2121,13 +2121,13 @@ class SaltCallOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
role = opts.get('id')
if not role:
emsg = ("Missing role required to setup RAET SaltCaller.")
log.error(emsg + "\n")
logging.getLogger(__name__).error(emsg + "\n")
raise ValueError(emsg)
kind = opts.get('__role') # application kind 'master', 'minion', etc
if kind not in kinds.APPL_KINDS:
emsg = ("Invalid application kind = '{0}' for RAET SaltCaller.".format(kind))
log.error(emsg + "\n")
logging.getLogger(__name__).error(emsg + "\n")
raise ValueError(emsg)
if kind in [kinds.APPL_KIND_NAMES[kinds.applKinds.minion],
@ -2135,7 +2135,7 @@ class SaltCallOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
lanename = "{0}_{1}".format(role, kind)
else:
emsg = ("Unsupported application kind '{0}' for RAET SaltCaller.".format(kind))
log.error(emsg + '\n')
logging.getLogger(__name__).error(emsg + '\n')
raise ValueError(emsg)
if kind == kinds.APPL_KIND_NAMES[kinds.applKinds.minion]: # minion check