This commit is contained in:
Mike Place 2014-10-22 13:07:05 -06:00
parent 217683bad3
commit f700a6587a
2 changed files with 6 additions and 8 deletions

View File

@ -673,7 +673,7 @@ class Loader(object):
if virtual_enable:
# if virtual modules are enabled, we need to look for the
# __virtual__() function inside that module and run it.
(virtual_ret, virtual_name, virtual_errors) = self.process_virtual(
(virtual_ret, virtual_name, _) = self.process_virtual(
mod,
module_name)
@ -681,9 +681,7 @@ class Loader(object):
# supposed to not process this module
if virtual_ret is not True:
# If a module has information about why it could not be loaded, record it
if virtual_errors:
error_funcs[module_name] = virtual_errors
return False # TODO Support virtual_errors here
return False # TODO Support virtual_errors here
# update our module name to reflect the virtual name
if getattr(mod, '__load__', False) is not False:
@ -1364,7 +1362,7 @@ class LazyLoader(MutableMapping):
if key not in self._dict and not self.loaded:
# load the item
mod_load = self._load(key)
if mod_load:
if mod_load:
log.debug('LazyLoaded {0}'.format(key))
return self._dict[key]
elif mod_load is False:

View File

@ -74,7 +74,7 @@ def lookup_jid(jid, ext_source=None, missing=False, outputter=None):
try:
data = mminion.returners['{0}.get_jid'.format(returner)](jid)
except TypeError:
print('Requested returner could not be loaded. No JIDs could be retreived.')
print 'Requested returner could not be loaded. No JIDs could be retreived.'
return
for minion in data:
if u'return' in data[minion]:
@ -132,7 +132,7 @@ def list_jobs(ext_source=None,
try:
ret = mminion.returners['{0}.get_jids'.format(returner)]()
except TypeError:
print('Error: Requested returner could not be loaded. No jobs could be retreived.')
print 'Error: Requested returner could not be loaded. No jobs could be retreived.'
return
if search_metadata:
@ -196,9 +196,9 @@ def print_job(jid, ext_source=None, outputter=None):
returner = _get_returner((__opts__['ext_job_cache'], ext_source, __opts__['master_job_cache']))
mminion = salt.minion.MasterMinion(__opts__)
ret[jid] = _format_jid_instance(jid, job)
try:
job = mminion.returners['{0}.get_load'.format(returner)](jid)
ret[jid] = _format_jid_instance(jid, job)
except TypeError:
ret[jid]['Result'] = 'Requested returner {0} is not available. Jobs cannot be retreived. '
'Check master log for details.'.format(returner)