mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
consul: add docs, fix typos, minor style fix
This commit is contained in:
parent
f7b6523ff5
commit
002ce4b352
1 changed files with 7 additions and 7 deletions
|
@ -98,6 +98,8 @@ options:
|
|||
- the address on which the service is serving required for
|
||||
registration of a service
|
||||
required: false
|
||||
default: localhost
|
||||
version_added: "2.1"
|
||||
tags:
|
||||
description:
|
||||
- a list of tags that will be attached to the service registration.
|
||||
|
@ -211,8 +213,6 @@ EXAMPLES = '''
|
|||
|
||||
'''
|
||||
|
||||
import sys
|
||||
|
||||
try:
|
||||
import consul
|
||||
from requests.exceptions import ConnectionError
|
||||
|
@ -298,8 +298,8 @@ def add_service(module, service):
|
|||
consul_api = get_consul_api(module)
|
||||
existing = get_service_by_id(consul_api, service.id)
|
||||
|
||||
# there is no way to retreive the details of checks so if a check is present
|
||||
# in the service it must be reregistered
|
||||
# there is no way to retrieve the details of checks so if a check is present
|
||||
# in the service it must be re-registered
|
||||
if service.has_checks() or not existing or not existing == service:
|
||||
|
||||
service.register(consul_api)
|
||||
|
@ -472,7 +472,7 @@ class ConsulCheck():
|
|||
self.check = consul.Check.ttl(self.ttl)
|
||||
|
||||
if http:
|
||||
if interval == None:
|
||||
if interval is None:
|
||||
raise Exception('http check must specify interval')
|
||||
|
||||
self.check = consul.Check.http(http, self.interval, self.timeout)
|
||||
|
@ -517,7 +517,7 @@ class ConsulCheck():
|
|||
|
||||
def _add(self, data, key, attr=None):
|
||||
try:
|
||||
if attr == None:
|
||||
if attr is None:
|
||||
attr = key
|
||||
data[key] = getattr(self, attr)
|
||||
except:
|
||||
|
|
Loading…
Reference in a new issue