Ungate the status.py module and raise unsupported errors in functions not executeable on Windows. (#39005)

This commit is contained in:
C. R. Oldham 2017-01-30 09:21:12 -07:00 committed by Nicole Thomas
parent e70904c480
commit a7fc02e196

View file

@ -38,13 +38,6 @@ __func_alias__ = {
}
def __virtual__():
if salt.utils.is_windows():
return False, 'Windows platform is not supported by this module'
return __virtualname__
def _number(text):
'''
Convert a string to a number.
@ -71,6 +64,8 @@ def procs():
salt '*' status.procs
'''
# Get the user, pid and cmd
if salt.utils.is_windows():
raise CommandExecutionError('This platform is not supported')
ret = {}
uind = 0
pind = 0
@ -119,6 +114,8 @@ def custom():
salt '*' status.custom
'''
if salt.utils.is_windows():
raise CommandExecutionError('This platform is not supported')
ret = {}
conf = __salt__['config.dot_vals']('status')
for key, val in six.iteritems(conf):
@ -587,6 +584,10 @@ def diskusage(*args):
salt '*' status.diskusage ext? # usage for ext[234] filesystems
salt '*' status.diskusage / ext? # usage for / and all ext filesystems
'''
if salt.utils.is_windows():
raise CommandExecutionError('This platform is not supported')
selected = set()
fstypes = set()
if not args:
@ -925,6 +926,8 @@ def w(): # pylint: disable=C0103
salt '*' status.w
'''
if salt.utils.is_windows():
raise CommandExecutionError('This platform is not supported')
user_list = []
users = __salt__['cmd.run']('w -h').splitlines()
for row in users: