juju status / output changes

Kapil Thangavelu kapil.thangavelu at canonical.com
Sat Mar 17 05:26:24 UTC 2012


Hi Folks

While discussing a current status bug its become clear that we need to
make a change to the status format. We're taking this need for an output
change toalso take an opportunity to change some other keys for consistency
and to reduce ambiguity.

Using the existing output of status to outline these changes. 

./bin/juju status -e public
2012-03-17 00:36:51,252 INFO Connecting to environment...
2012-03-17 00:36:53,102 INFO Connected to environment.
machines:
  0:
    dns-name: ec2-107-21-132-167.compute-1.amazonaws.com
    instance-id: i-41b2d825
    instance-state: running
    state: running
  1:
    dns-name: ec2-50-19-34-170.compute-1.amazonaws.com
    instance-id: i-adb6dcc9
    instance-state: running
    state: running
  2:
    dns-name: ec2-50-17-11-155.compute-1.amazonaws.com
    instance-id: i-a9b6dccd
    instance-state: running
    state: running
  3:
    dns-name: ec2-50-17-163-147.compute-1.amazonaws.com
    instance-id: i-81f79de5
    instance-state: running
    state: running
services:
  myblog:
    charm: local:precise/wordpress-31
    relations:
      db: mysql
    units:
      myblog/0:
        machine: 2
        public-address: ec2-50-17-11-155.compute-1.amazonaws.com
        relations:
          db:
            state: up
        state: started
  mysql:
    charm: local:precise/mysql-11
    relations:
      db: teamblog
    units:
      mysql/0:
        machine: 1
        public-address: ec2-50-19-34-170.compute-1.amazonaws.com
        relations:
          db:
            state: up
        state: started
  teamblog:
    charm: local:precise/wordpress-31
    relations:
      db: mysql
    units:
    units:
      teamblog/0:
        machine: 3
        public-address: ec2-50-17-163-147.compute-1.amazonaws.com
        relations:
          db:
            state: down
        state: config_error
2012-03-17 00:36:55,220 INFO 'status' command finished successfully


The immediate bug is that service's providing a service interface may
have multiple clients bound to them is listed under a dictionary key,
preventing the multiple services here from being presented. Also note
teamblog/0's is representing a relation error state as 'down'. The
proposed change is to switch to a different unit relation output::

    units:
      mysql/0:
      relations:
        db: [myblog]
      relations-error:
        db: [teamblog]

Services with multiple client relations to a single server, will be
reported only once. If any of those relations is an error state, the
service will be reported in the relation-errors block. The block will
not exist unless an error is present.

The agent status information for machines and units will change its
key from 'state' to 'agent-state'. In particular under the machine
which also reports 'instance-state', the 'state' key was deemed
ambigious. Switching out the respective blocks from above with the
following::


machine:
  1:
    dns-name: ec2-50-19-34-170.compute-1.amazonaws.com
    instance-id: i-adb6dcc9
    instance-state: running
    agent-state: running

    units:
      myblog/0:
        machine: 2
        public-address: ec2-50-17-11-155.compute-1.amazonaws.com
        relations:
          db:
            state: up
        agent-state: started


The final change is switching out unit agent state values from using
underscores to using hyphens to be consistent with usage everywhere else
with juju ie::

        state: config_error

    Changes to

        state: config-error

These changes will break existing tools that parse status output, but
its better to make the change now before 12.04.

The goal is to land these next week. Feedback welcome.


cheers,

Kapil



More information about the Juju mailing list