diff --git a/releasenotes/notes/persist-error-message-cda8dfe485fe92ba.yaml b/releasenotes/notes/persist-error-message-cda8dfe485fe92ba.yaml new file mode 100644 index 00000000..78c04ab7 --- /dev/null +++ b/releasenotes/notes/persist-error-message-cda8dfe485fe92ba.yaml @@ -0,0 +1,4 @@ +--- +features: + - Support added for error messages when running the + Trove show command. diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py index 666ba3cb..6ff9785d 100644 --- a/troveclient/v1/shell.py +++ b/troveclient/v1/shell.py @@ -88,6 +88,12 @@ def _print_instance(instance): if hasattr(instance, 'replicas'): replicas = [replica['id'] for replica in instance.replicas] info['replicas'] = ', '.join(replicas) + if hasattr(instance, 'fault'): + info.pop('fault', None) + info['fault'] = instance.fault['message'] + info['fault_date'] = instance.fault['created'] + if 'details' in instance.fault and instance.fault['details']: + info['fault_details'] = instance.fault['details'] info.pop('links', None) utils.print_dict(info)