diff --git a/ansible/roles/ironic-inspector-rules/library/os_ironic_inspector_rule.py b/ansible/roles/ironic-inspector-rules/library/os_ironic_inspector_rule.py index c84743a51..896ad793c 100644 --- a/ansible/roles/ironic-inspector-rules/library/os_ironic_inspector_rule.py +++ b/ansible/roles/ironic-inspector-rules/library/os_ironic_inspector_rule.py @@ -88,7 +88,7 @@ def _ensure_rule_present(module, client): if not response.ok: if response.status_code != 404: module.fail_json(msg="Failed retrieving Inspector rule %s: %s" - % (module.params['uuid'], repr(e))) + % (module.params['uuid'], response.text)) else: rule = response.json() # Check whether the rule differs from the request. diff --git a/releasenotes/notes/bug-2162058-17526c834c348df3.yaml b/releasenotes/notes/bug-2162058-17526c834c348df3.yaml new file mode 100644 index 000000000..37d39d83d --- /dev/null +++ b/releasenotes/notes/bug-2162058-17526c834c348df3.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes displaying the error when a failure to retrieve an inspection rule + occurs. `LP#2162058 `__