mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
openbsdrcctl: turn badvar into a tuple and fix lint warnings
This commit is contained in:
parent
113c56a8da
commit
7b99eeb6ab
@ -91,12 +91,12 @@ def get_all():
|
|||||||
|
|
||||||
salt '*' service.get_all
|
salt '*' service.get_all
|
||||||
'''
|
'''
|
||||||
badvar = [ "_timeout", "_user" ]
|
badvar = ("_timeout", "_user")
|
||||||
ret = []
|
ret = []
|
||||||
service = _cmd()
|
service = _cmd()
|
||||||
for svc in __salt__['cmd.run']('{0} getall'.format(service)).splitlines():
|
for svc in __salt__['cmd.run']('{0} getall'.format(service)).splitlines():
|
||||||
svc = re.sub('(_flags|)=.*$', '', svc)
|
svc = re.sub('(_flags|)=.*$', '', svc)
|
||||||
if not svc.endswith(tuple(badvar)):
|
if not svc.endswith(badvar):
|
||||||
ret.append(svc)
|
ret.append(svc)
|
||||||
return sorted(ret)
|
return sorted(ret)
|
||||||
|
|
||||||
@ -111,13 +111,13 @@ def get_disabled():
|
|||||||
|
|
||||||
salt '*' service.get_disabled
|
salt '*' service.get_disabled
|
||||||
'''
|
'''
|
||||||
badvar = [ "_timeout", "_user" ]
|
badvar = ("_timeout", "_user")
|
||||||
ret = []
|
ret = []
|
||||||
service = _cmd()
|
service = _cmd()
|
||||||
for svc in __salt__['cmd.run']('{0} getall'.format(service)).splitlines():
|
for svc in __salt__['cmd.run']('{0} getall'.format(service)).splitlines():
|
||||||
if svc.endswith("=NO"):
|
if svc.endswith("=NO"):
|
||||||
svc = re.sub('(_flags|)=.*$', '', svc)
|
svc = re.sub('(_flags|)=.*$', '', svc)
|
||||||
if not svc.endswith(tuple(badvar)):
|
if not svc.endswith(badvar):
|
||||||
ret.append(svc)
|
ret.append(svc)
|
||||||
return sorted(ret)
|
return sorted(ret)
|
||||||
|
|
||||||
@ -132,13 +132,13 @@ def get_enabled():
|
|||||||
|
|
||||||
salt '*' service.get_enabled
|
salt '*' service.get_enabled
|
||||||
'''
|
'''
|
||||||
badvar = [ "_timeout", "_user" ]
|
badvar = ("_timeout", "_user")
|
||||||
ret = []
|
ret = []
|
||||||
service = _cmd()
|
service = _cmd()
|
||||||
for svc in __salt__['cmd.run']('{0} getall'.format(service)).splitlines():
|
for svc in __salt__['cmd.run']('{0} getall'.format(service)).splitlines():
|
||||||
if not svc.endswith("=NO"):
|
if not svc.endswith("=NO"):
|
||||||
svc = re.sub('(_flags|)=.*$', '', svc)
|
svc = re.sub('(_flags|)=.*$', '', svc)
|
||||||
if not svc.endswith(tuple(badvar)):
|
if not svc.endswith(badvar):
|
||||||
ret.append(svc)
|
ret.append(svc)
|
||||||
return sorted(ret)
|
return sorted(ret)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user