openbsdrcctl: turn badvar into a tuple and fix lint warnings

This commit is contained in:
Antoine Jacoutot 2015-01-06 18:14:23 +01:00
parent 113c56a8da
commit 7b99eeb6ab

View File

@ -91,12 +91,12 @@ def get_all():
salt '*' service.get_all
'''
badvar = [ "_timeout", "_user" ]
badvar = ("_timeout", "_user")
ret = []
service = _cmd()
for svc in __salt__['cmd.run']('{0} getall'.format(service)).splitlines():
svc = re.sub('(_flags|)=.*$', '', svc)
if not svc.endswith(tuple(badvar)):
if not svc.endswith(badvar):
ret.append(svc)
return sorted(ret)
@ -111,13 +111,13 @@ def get_disabled():
salt '*' service.get_disabled
'''
badvar = [ "_timeout", "_user" ]
badvar = ("_timeout", "_user")
ret = []
service = _cmd()
for svc in __salt__['cmd.run']('{0} getall'.format(service)).splitlines():
if svc.endswith("=NO"):
svc = re.sub('(_flags|)=.*$', '', svc)
if not svc.endswith(tuple(badvar)):
if not svc.endswith(badvar):
ret.append(svc)
return sorted(ret)
@ -132,13 +132,13 @@ def get_enabled():
salt '*' service.get_enabled
'''
badvar = [ "_timeout", "_user" ]
badvar = ("_timeout", "_user")
ret = []
service = _cmd()
for svc in __salt__['cmd.run']('{0} getall'.format(service)).splitlines():
if not svc.endswith("=NO"):
svc = re.sub('(_flags|)=.*$', '', svc)
if not svc.endswith(tuple(badvar)):
if not svc.endswith(badvar):
ret.append(svc)
return sorted(ret)