mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Ungate the status.py module and raise unsupported errors in functions not executeable on Windows. (#39005)
This commit is contained in:
parent
e70904c480
commit
a7fc02e196
1 changed files with 10 additions and 7 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue