From cee3d539cbfd6bfe39ed3902112a06461cf0ea39 Mon Sep 17 00:00:00 2001 From: Wojciech Wypior Date: Fri, 21 Jun 2019 14:45:58 +0100 Subject: [PATCH] Fixes issue with failure messages (#58173) --- .../modules/network/f5/bigip_appsvcs_extension.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/network/f5/bigip_appsvcs_extension.py b/lib/ansible/modules/network/f5/bigip_appsvcs_extension.py index a33a13ad2f4..b9f37deff1f 100644 --- a/lib/ansible/modules/network/f5/bigip_appsvcs_extension.py +++ b/lib/ansible/modules/network/f5/bigip_appsvcs_extension.py @@ -496,9 +496,13 @@ class ModuleManager(object): self.want.tenants ) response = self.client.api.delete(uri) - if response.status == 200: - return True - raise F5ModuleError(response.content) + if response.status != 200: + result = response.json() + errors = self._get_errors_from_response(result) + if errors: + message = "{0}".format('. '.join(errors)) + raise F5ModuleError(message) + raise F5ModuleError(response.content) class ArgumentSpec(object):