mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
add ability to customize cloud config options in cloud runner functions: destroy, action and map_run
This commit is contained in:
parent
a5bb896ff1
commit
722ed9effd
@ -115,20 +115,24 @@ def profile(prof=None, instances=None, opts=None, **kwargs):
|
||||
return info
|
||||
|
||||
|
||||
def map_run(path=None, **kwargs):
|
||||
def map_run(path=None, , opts=None, **kwargs):
|
||||
'''
|
||||
Execute a salt cloud map file
|
||||
'''
|
||||
client = _get_client()
|
||||
if isinstance(opts, dict):
|
||||
client.opts.update(opts)
|
||||
info = client.map_run(path, **salt.utils.args.clean_kwargs(**kwargs))
|
||||
return info
|
||||
|
||||
|
||||
def destroy(instances):
|
||||
def destroy(instances, opts=None):
|
||||
'''
|
||||
Destroy the named vm(s)
|
||||
'''
|
||||
client = _get_client()
|
||||
if isinstance(opts, dict):
|
||||
client.opts.update(opts)
|
||||
info = client.destroy(instances)
|
||||
return info
|
||||
|
||||
@ -138,6 +142,7 @@ def action(func=None,
|
||||
instances=None,
|
||||
provider=None,
|
||||
instance=None,
|
||||
opts=None,
|
||||
**kwargs):
|
||||
'''
|
||||
Execute a single action on the given map/provider/instance
|
||||
@ -150,6 +155,8 @@ def action(func=None,
|
||||
'''
|
||||
info = {}
|
||||
client = _get_client()
|
||||
if isinstance(opts, dict):
|
||||
client.opts.update(opts)
|
||||
try:
|
||||
info = client.action(
|
||||
func,
|
||||
|
Loading…
Reference in New Issue
Block a user