consul_session: ensure scheme parameter is used (#58692)

* Ensure an error occurs when unknown scheme is used
* consul_session: don't ignore 'scheme' parameter
pull/58984/head
Pilou 5 years ago committed by Sam Doran
parent 7346b699ee
commit ef1cf2d2e8

@ -0,0 +1,2 @@
bugfixes:
- "consul_session: don't ignore ``scheme`` parameter"

@ -232,7 +232,8 @@ def remove_session(module):
def get_consul_api(module):
return consul.Consul(host=module.params.get('host'),
port=module.params.get('port'))
port=module.params.get('port'),
scheme=module.params.get('scheme'))
def test_dependencies(module):

@ -70,6 +70,18 @@
that:
- result is failed
- name: ensure unknown scheme fails
consul_session:
state: info
id: '{{ session_id }}'
scheme: non_existent
register: result
ignore_errors: True
- assert:
that:
- result is failed
- name: delete a session
consul_session:
state: absent

Loading…
Cancel
Save