mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Seperate prlctl and prlsrvctl checks into each requiring function
This commit is contained in:
parent
936cae5017
commit
752b6f8546
1 changed files with 6 additions and 11 deletions
|
@ -43,17 +43,6 @@ log = logging.getLogger(__name__)
|
|||
GUID_REGEX = re.compile(r'{?([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})}?', re.I)
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Load this module if prlctl is available
|
||||
'''
|
||||
if not salt.utils.path.which('prlctl'):
|
||||
return (False, 'prlctl utility not available')
|
||||
if not salt.utils.path.which('prlsrvctl'):
|
||||
return (False, 'prlsrvctl utility not available')
|
||||
return __virtualname__
|
||||
|
||||
|
||||
def _normalize_args(args):
|
||||
'''
|
||||
Return args as a list of strings
|
||||
|
@ -111,6 +100,9 @@ def prlsrvctl(sub_cmd, args=None, runas=None):
|
|||
salt '*' parallels.prlsrvctl usb list runas=macdev
|
||||
salt -- '*' parallels.prlsrvctl set '--mem-limit auto' runas=macdev
|
||||
'''
|
||||
if not salt.utils.path.which('prlsrvctl'):
|
||||
raise CommandExecutionError('prlsrvctl utility not available')
|
||||
|
||||
# Construct command
|
||||
cmd = ['prlsrvctl', sub_cmd]
|
||||
if args:
|
||||
|
@ -141,6 +133,9 @@ def prlctl(sub_cmd, args=None, runas=None):
|
|||
salt '*' parallels.prlctl exec 'macvm uname' runas=macdev
|
||||
salt -- '*' parallels.prlctl capture 'macvm --file macvm.display.png' runas=macdev
|
||||
'''
|
||||
if not salt.utils.path.which('prlctl'):
|
||||
raise CommandExecutionError('prlctl utility not available')
|
||||
|
||||
# Construct command
|
||||
cmd = ['prlctl', sub_cmd]
|
||||
if args:
|
||||
|
|
Loading…
Add table
Reference in a new issue