Output to action 'cluster-status' is not user friendly

Bug #1943198 reported by Peter Matulis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack RabbitMQ Server Charm
Fix Released
Wishlist
Anna Savchenko

Bug Description

The output to action 'cluster-status' is not user friendly.

$ juju run-action --wait rabbitmq-server/leader cluster-status

unit-rabbitmq-server-0:
  UnitId: rabbitmq-server/0
  id: "26"
  results:
    output: "Cluster status of node rabbit@juju-20f28c-openstack-18 ...\n\e[1mBasics\e[0m\n\nCluster
      name: <email address hidden>\n\n\e[1mDisk Nodes\e[0m\n\nrabbit@juju-20f28c-openstack-18\n\n\e[1mRunning
      Nodes\e[0m\n\nrabbit@juju-20f28c-openstack-18\n\n\e[1mVersions\e[0m\n\nrabbit@juju-20f28c-openstack-18:
      RabbitMQ 3.8.2 on Erlang 22.2.7\n\n\e[1mAlarms\e[0m\n\n(none)\n\n\e[1mNetwork
      Partitions\e[0m\n\n(none)\n\n\e[1mListeners\e[0m\n\nNode: rabbit@juju-20f28c-openstack-18,
      interface: [::], port: 25672, protocol: clustering, purpose: inter-node and
      CLI tool communication\nNode: rabbit@juju-20f28c-openstack-18, interface: [::],
      port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0\n\n\e[1mFeature
      flags\e[0m\n\nFlag: implicit_default_bindings, state: enabled\nFlag: quorum_queue,
      state: enabled\nFlag: virtual_host_metadata, state: enabled\n"
  status: completed
  timing:
    completed: 2021-09-10 02:11:25 +0000 UTC
    enqueued: 2021-09-10 02:11:22 +0000 UTC
    started: 2021-09-10 02:11:23 +0000 UTC

Revision history for this message
Felipe Reyes (freyes) wrote :

"rabbitmqctl cluster_status" uses escape codes to color/highlight the output and it doesn't have a way to suppress this.

There is a new command, which if I'm not mistaken, was added in rabbit 3.7 that supports json format ouput.

sudo rabbitmq-diagnostics cluster_status --formatter json

Changed in charm-rabbitmq-server:
importance: Undecided → Wishlist
status: New → Triaged
tags: added: good-first-bug
Revision history for this message
Corey Bryant (corey.bryant) wrote :

rabbitmq-server 3.7+ is available in the default archives since focal:

 rabbitmq-server | 3.6.10-1 | bionic | source, all
 rabbitmq-server | 3.6.10-1ubuntu0.5 | bionic-security | source, all
 rabbitmq-server | 3.6.10-1ubuntu0.5 | bionic-updates | source, all
 rabbitmq-server | 3.8.2-0ubuntu1~ubuntu18.04.1 | bionic-backports | source, all
 rabbitmq-server | 3.8.2-0ubuntu1 | focal | source, all
 rabbitmq-server | 3.8.2-0ubuntu1.3 | focal-security | source, all
 rabbitmq-server | 3.8.2-0ubuntu1.3 | focal-updates | source, all
 rabbitmq-server | 3.8.9-2 | hirsute | source, all
 rabbitmq-server | 3.8.9-2ubuntu0.1 | hirsute-security | source, all
 rabbitmq-server | 3.8.9-2ubuntu0.1 | hirsute-updates | source, all
 rabbitmq-server | 3.8.9-3ubuntu1 | impish | source, all

Changed in charm-rabbitmq-server:
assignee: nobody → Anna Savchenko (annsavchenko)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-rabbitmq-server (master)
Changed in charm-rabbitmq-server:
status: Triaged → In Progress
Changed in charm-rabbitmq-server:
status: In Progress → Fix Committed
milestone: none → 22.04
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-rabbitmq-server (master)

Reviewed: https://review.opendev.org/c/openstack/charm-rabbitmq-server/+/814418
Committed: https://opendev.org/openstack/charm-rabbitmq-server/commit/223ec26617e8c6fca1c02e280410708d23dcd81c
Submitter: "Zuul (22348)"
Branch: master

commit 223ec26617e8c6fca1c02e280410708d23dcd81c
Author: Anna Savchenko <email address hidden>
Date: Mon Oct 18 15:24:03 2021 +0300

    Modify the output to action "cluster-status"
    to make it user friendly (rabbitmq)

    "rabbitmqctl cluster_status" uses escape codes to color/highlight the
    output, and it does not have a way to suppress this. This makes the
    output to the command "juju run-action rabbitmq-server/leader
    cluster-status" not user friendly and difficult to read.

    Add the json formatting option to the rabbitmqctl command and use
    the json.dumps method to get a user friendly output.

    Add unit test.

    Closes-Bug: #1943198
    Change-Id: I24380e24ff1edbede9c2db1671a4fc05d5a7cc63

Changed in charm-rabbitmq-server:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.