consul: Always fail if no service_name was provided. (#25877)

Fixes a subtile bug introduced in PR #21737
This commit is contained in:
Steffen Neubauer 2017-08-30 21:26:36 +02:00 committed by ansibot
commit bf73377394
2 changed files with 13 additions and 2 deletions

View file

@ -389,8 +389,8 @@ def parse_service(module):
module.params.get('service_port'),
module.params.get('tags'),
)
elif module.params.get('service_port') and not module.params.get('service_name'):
module.fail_json(msg="service_port supplied but no service_name, a name is required to configure a service.")
elif not module.params.get('service_name'):
module.fail_json(msg="service_name is required to configure a service.")
class ConsulService():