mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Starting to dynamically generate functions
This commit is contained in:
parent
0e6b99245f
commit
17c4f5a988
@ -39,6 +39,7 @@ def _available_commands( ):
|
||||
if not zfs_path:
|
||||
return False
|
||||
|
||||
# TODO: Supress the ERROR log generated when we read stderr..
|
||||
_return = [ ]
|
||||
res = __salt__['cmd.run_all']("%s help" % zfs_path)
|
||||
for line in res['stderr'].splitlines( ):
|
||||
@ -63,12 +64,6 @@ def _exit_status(retcode):
|
||||
}[retcode]
|
||||
return ret
|
||||
|
||||
def test( ):
|
||||
'''
|
||||
Testing
|
||||
'''
|
||||
return _available_commands( )
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Makes sure that ZFS is available.
|
||||
@ -77,6 +72,12 @@ def __virtual__():
|
||||
return 'zfs'
|
||||
return False
|
||||
|
||||
# At this point use the helper commands to dynamically generate
|
||||
# functions that are available.
|
||||
for available_cmd in _available_commands( ):
|
||||
# Define a new function here based on avaiable_cmd.
|
||||
# Also update __func_alias__
|
||||
pass
|
||||
|
||||
def list_(*args):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user