Fixes issue with failure messages (#58173)

This commit is contained in:
Wojciech Wypior 2019-06-21 14:45:58 +01:00 committed by Tim Rupp
parent becca36c5e
commit cee3d539cb

View file

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