diff --git a/salt/wheel/__init__.py b/salt/wheel/__init__.py index eea532738c..7e4f772db5 100644 --- a/salt/wheel/__init__.py +++ b/salt/wheel/__init__.py @@ -30,7 +30,7 @@ class Wheel(object): ''' Execute a master control function ''' - if not fun in self.w_funcs: + if fun not in self.w_funcs: return 'Unknown wheel function' f_call = salt.utils.format_call(self.w_funcs[fun], kwargs) return self.w_funcs[fun](*f_call.get('args', ()), **f_call.get('kwargs', {})) diff --git a/salt/wheel/file_roots.py b/salt/wheel/file_roots.py index fe3b09f9ca..3effa0195c 100644 --- a/salt/wheel/file_roots.py +++ b/salt/wheel/file_roots.py @@ -34,7 +34,7 @@ def list_env(env='base'): Return all of the file paths found in an environment ''' ret = {} - if not env in __opts__['file_roots']: + if env not in __opts__['file_roots']: return ret for f_root in __opts__['file_roots'][env]: ret[f_root] = {} @@ -91,9 +91,9 @@ def write(data, path, env='base', index=0): Write the named file, by default the first file found is written, but the index of the file can be specified to write to a lower priority file root ''' - if not env in __opts__['file_roots']: + if env not in __opts__['file_roots']: return 'Named environment {0} is not present'.format(env) - if not len(__opts__['file_roots'][env]) > index: + if len(__opts__['file_roots'][env]) <= index: return 'Specified index {0} in environment {1} is not present'.format( index, env) if os.path.isabs(path): diff --git a/salt/wheel/pillar_roots.py b/salt/wheel/pillar_roots.py index 0d95283eb2..69eb603964 100644 --- a/salt/wheel/pillar_roots.py +++ b/salt/wheel/pillar_roots.py @@ -35,7 +35,7 @@ def list_env(env='base'): Return all of the file paths found in an environment ''' ret = {} - if not env in __opts__['pillar_roots']: + if env not in __opts__['pillar_roots']: return ret for f_root in __opts__['pillar_roots'][env]: ret[f_root] = {} @@ -92,7 +92,7 @@ def write(data, path, env='base', index=0): Write the named file, by default the first file found is written, but the index of the file can be specified to write to a lower priority file root ''' - if not env in __opts__['pillar_roots']: + if env not in __opts__['pillar_roots']: return 'Named environment {0} is not present'.format(env) if len(__opts__['pillar_roots'][env]) <= index: return 'Specified index {0} in environment {1} is not present'.format(