smf support cleanup

If it works on SmartOS and it works on Solaris, it's just plain the
right way to do things.
Remove the if statement.
This commit is contained in:
Nahum Shalman 2014-07-17 12:46:40 -04:00
parent 62d64daf1c
commit 90d0417428

View File

@ -89,8 +89,8 @@ def available(name):
Returns ``True`` if the specified service is available, otherwise returns
``False``.
The Solaris and SmartOS "if" statement uses svcs to return the service name from the
package name.
We look up the name with the svcs command to get back the FMRI
This allows users to use simpler service names
CLI Example:
@ -98,12 +98,9 @@ def available(name):
salt '*' service.available net-snmp
'''
if 'SmartOS' in __grains__['os'] or 'Solaris' in __grains__['os']:
cmd = '/usr/bin/svcs -H -o FMRI {0}'.format(name)
name = __salt__['cmd.run'](cmd)
return name in get_all()
else:
return name in get_all()
cmd = '/usr/bin/svcs -H -o FMRI {0}'.format(name)
name = __salt__['cmd.run'](cmd)
return name in get_all()
def missing(name):
@ -118,12 +115,9 @@ def missing(name):
salt '*' service.missing net-snmp
'''
if 'SmartOS' in __grains__['os'] or 'Solaris' in __grains__['os']:
cmd = '/usr/bin/svcs -H -o FMRI {0}'.format(name)
name = __salt__['cmd.run'](cmd)
return name not in get_all()
else:
return name not in get_all()
cmd = '/usr/bin/svcs -H -o FMRI {0}'.format(name)
name = __salt__['cmd.run'](cmd)
return name not in get_all()
def get_all():