mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
salt/minion.py: remove raw string formatting
This commit is contained in:
parent
4bf889c4ad
commit
e44fd6c0ff
@ -1023,7 +1023,7 @@ class Minion(MinionBase):
|
|||||||
)
|
)
|
||||||
ret['success'] = True
|
ret['success'] = True
|
||||||
except CommandNotFoundError as exc:
|
except CommandNotFoundError as exc:
|
||||||
msg = 'Command required for {0!r} not found'.format(
|
msg = 'Command required for \'{0}\' not found'.format(
|
||||||
function_name
|
function_name
|
||||||
)
|
)
|
||||||
log.debug(msg, exc_info=True)
|
log.debug(msg, exc_info=True)
|
||||||
@ -1031,7 +1031,7 @@ class Minion(MinionBase):
|
|||||||
ret['out'] = 'nested'
|
ret['out'] = 'nested'
|
||||||
except CommandExecutionError as exc:
|
except CommandExecutionError as exc:
|
||||||
log.error(
|
log.error(
|
||||||
'A command in {0!r} had a problem: {1}'.format(
|
'A command in \'{0}\' had a problem: {1}'.format(
|
||||||
function_name,
|
function_name,
|
||||||
exc
|
exc
|
||||||
),
|
),
|
||||||
@ -1041,13 +1041,13 @@ class Minion(MinionBase):
|
|||||||
ret['out'] = 'nested'
|
ret['out'] = 'nested'
|
||||||
except SaltInvocationError as exc:
|
except SaltInvocationError as exc:
|
||||||
log.error(
|
log.error(
|
||||||
'Problem executing {0!r}: {1}'.format(
|
'Problem executing \'{0}\': {1}'.format(
|
||||||
function_name,
|
function_name,
|
||||||
exc
|
exc
|
||||||
),
|
),
|
||||||
exc_info_on_loglevel=logging.DEBUG
|
exc_info_on_loglevel=logging.DEBUG
|
||||||
)
|
)
|
||||||
ret['return'] = 'ERROR executing {0!r}: {1}'.format(
|
ret['return'] = 'ERROR executing \'{0}\': {1}'.format(
|
||||||
function_name, exc
|
function_name, exc
|
||||||
)
|
)
|
||||||
ret['out'] = 'nested'
|
ret['out'] = 'nested'
|
||||||
@ -1066,7 +1066,9 @@ class Minion(MinionBase):
|
|||||||
ret['return'] = minion_instance.functions.missing_fun_string(function_name)
|
ret['return'] = minion_instance.functions.missing_fun_string(function_name)
|
||||||
mod_name = function_name.split('.')[0]
|
mod_name = function_name.split('.')[0]
|
||||||
if mod_name in minion_instance.function_errors:
|
if mod_name in minion_instance.function_errors:
|
||||||
ret['return'] += ' Possible reasons: {0!r}'.format(minion_instance.function_errors[mod_name])
|
ret['return'] += ' Possible reasons: \'{0}\''.format(
|
||||||
|
minion_instance.function_errors[mod_name]
|
||||||
|
)
|
||||||
ret['success'] = False
|
ret['success'] = False
|
||||||
ret['retcode'] = 254
|
ret['retcode'] = 254
|
||||||
ret['out'] = 'nested'
|
ret['out'] = 'nested'
|
||||||
@ -1454,7 +1456,7 @@ class Minion(MinionBase):
|
|||||||
'''
|
'''
|
||||||
Handle an event from the epull_sock (all local minion events)
|
Handle an event from the epull_sock (all local minion events)
|
||||||
'''
|
'''
|
||||||
log.debug('Handling event {0!r}'.format(package))
|
log.debug('Handling event \'{0}\''.format(package))
|
||||||
if package.startswith('module_refresh'):
|
if package.startswith('module_refresh'):
|
||||||
tag, data = salt.utils.event.MinionEvent.unpack(package)
|
tag, data = salt.utils.event.MinionEvent.unpack(package)
|
||||||
self.module_refresh(notify=data.get('notify', False))
|
self.module_refresh(notify=data.get('notify', False))
|
||||||
@ -1588,7 +1590,7 @@ class Minion(MinionBase):
|
|||||||
io_loop=self.io_loop,
|
io_loop=self.io_loop,
|
||||||
)
|
)
|
||||||
|
|
||||||
log.debug('Minion {0!r} trying to tune in'.format(self.opts['id']))
|
log.debug('Minion \'{0}\' trying to tune in'.format(self.opts['id']))
|
||||||
|
|
||||||
if start:
|
if start:
|
||||||
self.sync_connect_master()
|
self.sync_connect_master()
|
||||||
@ -1792,7 +1794,7 @@ class Syndic(Minion):
|
|||||||
Lock onto the publisher. This is the main event loop for the syndic
|
Lock onto the publisher. This is the main event loop for the syndic
|
||||||
'''
|
'''
|
||||||
signal.signal(signal.SIGTERM, self.clean_die)
|
signal.signal(signal.SIGTERM, self.clean_die)
|
||||||
log.debug('Syndic {0!r} trying to tune in'.format(self.opts['id']))
|
log.debug('Syndic \'{0}\' trying to tune in'.format(self.opts['id']))
|
||||||
|
|
||||||
if start:
|
if start:
|
||||||
self.sync_connect_master()
|
self.sync_connect_master()
|
||||||
@ -2061,7 +2063,7 @@ class MultiSyndic(MinionBase):
|
|||||||
self.local = salt.client.get_local_client(self.opts['_minion_conf_file'])
|
self.local = salt.client.get_local_client(self.opts['_minion_conf_file'])
|
||||||
self.local.event.subscribe('')
|
self.local.event.subscribe('')
|
||||||
|
|
||||||
log.debug('MultiSyndic {0!r} trying to tune in'.format(self.opts['id']))
|
log.debug('MultiSyndic \'{0}\' trying to tune in'.format(self.opts['id']))
|
||||||
|
|
||||||
# register the event sub to the poller
|
# register the event sub to the poller
|
||||||
self._reset_event_aggregation()
|
self._reset_event_aggregation()
|
||||||
|
Loading…
Reference in New Issue
Block a user