consul_session: ensure scheme parameter is used (#58692)

* Ensure an error occurs when unknown scheme is used
* consul_session: don't ignore 'scheme' parameter
This commit is contained in:
Pilou 2019-07-10 13:16:18 +00:00 committed by Sam Doran
parent 7346b699ee
commit ef1cf2d2e8
3 changed files with 16 additions and 1 deletions

View file

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

View file

@ -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):

View file

@ -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