mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
More pylint fixes
This commit is contained in:
parent
258c978b11
commit
234b9c210e
@ -760,7 +760,7 @@ class NewLazyLoader(salt.utils.lazy.LazyDict):
|
||||
pack=None,
|
||||
whitelist=None,
|
||||
virtual_enable=True,
|
||||
):
|
||||
): # pylint: disable=@0231
|
||||
self.opts = self.__prep_mod_opts(opts)
|
||||
|
||||
# an init for the singleton instance to call
|
||||
@ -817,13 +817,12 @@ class NewLazyLoader(salt.utils.lazy.LazyDict):
|
||||
for (suffix, mode, kind) in imp.get_suffixes():
|
||||
self.suffix_map[suffix] = (suffix, mode, kind)
|
||||
|
||||
|
||||
if self.opts.get('cython_enable', True) is True:
|
||||
try:
|
||||
import pyximport # pylint: disable=import-error
|
||||
import pyximport # pylint: disable=import-error
|
||||
pyximport.install()
|
||||
# add to suffix_map so file_mapping will pick it up
|
||||
self.suffix_map['.pyx'] = typle()
|
||||
self.suffix_map['.pyx'] = tuple()
|
||||
except ImportError:
|
||||
log.info('Cython is enabled in the options but not present '
|
||||
'in the system path. Skipping Cython modules.')
|
||||
@ -912,7 +911,7 @@ class NewLazyLoader(salt.utils.lazy.LazyDict):
|
||||
if mod_name not in k:
|
||||
yield k
|
||||
|
||||
def _reload_submodules(self, mod):
|
||||
def _reload_submodules(self, name, mod):
|
||||
submodules = [
|
||||
getattr(mod, sname) for sname in dir(mod) if
|
||||
isinstance(getattr(mod, sname), mod.__class__)
|
||||
@ -942,7 +941,7 @@ class NewLazyLoader(salt.utils.lazy.LazyDict):
|
||||
self.loaded_files.append(name)
|
||||
try:
|
||||
if suffix == '.pyx':
|
||||
mod = pyximport.load_module(name, full, tempfile.gettempdir())
|
||||
mod = pyximport.load_module(name, fpath, tempfile.gettempdir())
|
||||
else:
|
||||
desc = self.suffix_map[suffix]
|
||||
with open(fpath, desc[1]) as fn_:
|
||||
@ -955,7 +954,7 @@ class NewLazyLoader(salt.utils.lazy.LazyDict):
|
||||
), fn_, fpath, desc)
|
||||
# reload all submodules if necessary
|
||||
if not self.initial_load and False:
|
||||
self._reload_submodules(mod)
|
||||
self._reload_submodules(name, mod)
|
||||
|
||||
except IOError:
|
||||
raise
|
||||
@ -1235,7 +1234,6 @@ class NewLazyLoader(salt.utils.lazy.LazyDict):
|
||||
))
|
||||
|
||||
if not hasattr(mod, '__virtualname__'):
|
||||
'''
|
||||
salt.utils.warn_until(
|
||||
'Hydrogen',
|
||||
'The {0!r} module is renaming itself in it\'s '
|
||||
@ -1248,7 +1246,6 @@ class NewLazyLoader(salt.utils.lazy.LazyDict):
|
||||
virtual
|
||||
)
|
||||
)
|
||||
'''
|
||||
|
||||
if virtualname != virtual:
|
||||
# The __virtualname__ attribute does not match what's
|
||||
|
Loading…
Reference in New Issue
Block a user