Merge pull request #41901 from coolstone16/httpquery_receive_opts

Allow modifiable opts for http.query in module and runner.
This commit is contained in:
Mike Place 2017-06-22 15:36:33 -05:00 committed by GitHub
commit d1f80bab39
2 changed files with 11 additions and 2 deletions

View File

@ -30,7 +30,12 @@ def query(url, **kwargs):
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
opts = __opts__.copy()
if 'opts' in kwargs:
opts.update(kwargs['opts'])
del kwargs['opts']
return salt.utils.http.query(url=url, opts=opts, **kwargs)
def wait_for_successful_query(url, wait_for=300, **kwargs):

View File

@ -35,8 +35,12 @@ def query(url, output=True, **kwargs):
log.warning('Output option has been deprecated. Please use --quiet.')
if 'node' not in kwargs:
kwargs['node'] = 'master'
opts = __opts__.copy()
if 'opts' in kwargs:
opts.update(kwargs['opts'])
del kwargs['opts']
ret = salt.utils.http.query(url=url, opts=__opts__, **kwargs)
ret = salt.utils.http.query(url=url, opts=opts, **kwargs)
return ret