mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
pylint fixes
This commit is contained in:
parent
656a8d1339
commit
b74b2dde60
@ -69,13 +69,13 @@ def splay(*args, **kwargs):
|
|||||||
|
|
||||||
func = args.pop(0)
|
func = args.pop(0)
|
||||||
# Check if the func is valid before the sleep
|
# Check if the func is valid before the sleep
|
||||||
if not func in __salt__:
|
if func not in __salt__:
|
||||||
raise CommandExecutionError('Unable to find module function {0}'.format(func))
|
raise CommandExecutionError('Unable to find module function {0}'.format(func))
|
||||||
|
|
||||||
my_delay = _calc_splay(__grains__['id'], splaytime=splaytime)
|
my_delay = _calc_splay(__grains__['id'], splaytime=splaytime)
|
||||||
time.sleep(my_delay)
|
time.sleep(my_delay)
|
||||||
# Get rid of the hidden kwargs that salt injects
|
# Get rid of the hidden kwargs that salt injects
|
||||||
func_kwargs = dict((k,v) for k,v in kwargs.iteritems() if not k.startswith('__'))
|
func_kwargs = dict((k, v) for k, v in kwargs.iteritems() if not k.startswith('__'))
|
||||||
result = __salt__[func](*args, **func_kwargs)
|
result = __salt__[func](*args, **func_kwargs)
|
||||||
if type(result) != dict:
|
if type(result) != dict:
|
||||||
result = {'result': result}
|
result = {'result': result}
|
||||||
|
Loading…
Reference in New Issue
Block a user