mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
putting look back in, do some linting #2124
This commit is contained in:
parent
d2869b2f22
commit
87eeec7180
2 changed files with 16 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
bugfixes:
|
bugfixes:
|
||||||
- consul_kv lookup - use ``self.get_option`` and
|
- consul_kv lookup - use ``self.get_option`` and
|
||||||
remove the function parse_params all together with its for loop
|
remove the function parse_params get key form self.terms
|
||||||
(https://github.com/ansible-collections/community.general/issues/2124).
|
(https://github.com/ansible-collections/community.general/issues/2124).
|
||||||
|
|
|
@ -126,7 +126,6 @@ class LookupModule(LookupBase):
|
||||||
|
|
||||||
# get options
|
# get options
|
||||||
self.set_options(direct=kwargs)
|
self.set_options(direct=kwargs)
|
||||||
key = terms[0].split(' ')[0]
|
|
||||||
scheme = self.get_option('scheme')
|
scheme = self.get_option('scheme')
|
||||||
host = self.get_option('host')
|
host = self.get_option('host')
|
||||||
port = self.get_option('port')
|
port = self.get_option('port')
|
||||||
|
@ -148,8 +147,10 @@ class LookupModule(LookupBase):
|
||||||
|
|
||||||
values = []
|
values = []
|
||||||
try:
|
try:
|
||||||
consul_api = consul.Consul(host=host, port=port, scheme=scheme, token=token, dc=datacenter,
|
for term in terms:
|
||||||
verify=validate_certs, cert=client_cert)
|
key = term.split(' ')[0]
|
||||||
|
consul_api = consul.Consul(host=host, port=port, scheme=scheme, token=token,
|
||||||
|
dc=datacenter,verify=validate_certs, cert=client_cert)
|
||||||
|
|
||||||
results = consul_api.kv.get(key,
|
results = consul_api.kv.get(key,
|
||||||
index=index,
|
index=index,
|
||||||
|
|
Loading…
Reference in a new issue