openrc: Need for more robust parsing of `juju status` output

Bug #1811697 reported by Frode Nordahl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Bundles
Fix Released
Medium
Frode Nordahl

Bug Description

Juju 2.5 adds listing of `storage` and `volumes` to `juju status` output, this means that in some situations our primitive AWK processing of the YAML is not sufficient.

Example scenario:
ubuntu@test:~$ juju status keystone --format yaml
model:
  name: default
  type: iaas
  controller: fnordahl-serverstack
  cloud: serverstack
  region: serverstack
  version: 2.5-rc2
  model-status:
    current: available
    since: 09 Jan 2019 10:59:26Z
  sla: unsupported
machines:
  "8":
    juju-status:
      current: started
      since: 09 Jan 2019 15:18:44Z
      version: 2.5-rc2
    dns-name: 10.5.0.20
    ip-addresses:
    - 10.5.0.20
    - 252.0.20.1
    instance-id: b77add10-7965-4eb8-9d60-172a0c285412
    machine-status:
      current: running
      message: ACTIVE
      since: 09 Jan 2019 15:13:24Z
    series: bionic
    network-interfaces:
      ens3:
        ip-addresses:
        - 10.5.0.20
        mac-address: fa:16:3e:eb:cf:f4
        gateway: 10.5.0.1
        is-up: true
      fan-252:
        ip-addresses:
        - 252.0.20.1
        mac-address: 32:bd:f4:83:bf:30
        is-up: true
    constraints: virt-type=kvm
    hardware: arch=amd64 cores=2 mem=1536M root-disk=15360M availability-zone=nova
applications:
  keystone:
    charm: cs:~openstack-charmers-next/keystone-401
    series: bionic
    os: ubuntu
    charm-origin: jujucharms
    charm-name: keystone
    charm-rev: 401
    can-upgrade-to: cs:~openstack-charmers-next/keystone-403
    exposed: false
    application-status:
      current: active
      message: Unit is ready
      since: 09 Jan 2019 15:25:39Z
    relations:
      cluster:
      - keystone
      identity-credentials:
      - ceilometer
      identity-service:
      - gnocchi
      shared-db:
      - percona-cluster
    units:
      keystone/0:
        workload-status:
          current: active
          message: Unit is ready
          since: 09 Jan 2019 15:25:39Z
        juju-status:
          current: idle
          since: 14 Jan 2019 15:05:06Z
          version: 2.5-rc2
        leader: true
        machine: "8"
        open-ports:
        - 5000/tcp
        public-address: 10.5.0.20
    version: 13.0.2
    endpoint-bindings:
      admin: ""
      certificates: ""
      cluster: ""
      domain-backend: ""
      ha: ""
      identity-admin: ""
      identity-credentials: ""
      identity-notifications: ""
      identity-service: ""
      internal: ""
      keystone-fid-service-provider: ""
      nrpe-external-master: ""
      public: ""
      shared-db: ""
      websso-trusted-dashboard: ""
storage:
  storage:
    osd-devices/0:
      kind: block
      life: alive
      status:
        current: attached
        since: 09 Jan 2019 15:13:21Z
      persistent: true
      attachments:
        units:
          ceph-osd/0:
            machine: "4"
            location: /dev/vdd
            life: alive
    osd-devices/1:
      kind: block
      life: alive
      status:
        current: attached
        since: 09 Jan 2019 15:13:21Z
      persistent: true
      attachments:
        units:
          ceph-osd/1:
            machine: "5"
            location: /dev/vdd
            life: alive
    osd-devices/2:
      kind: block
      life: alive
      status:
        current: attached
        since: 09 Jan 2019 15:13:19Z
      persistent: true
      attachments:
        units:
          ceph-osd/2:
            machine: "6"
            location: /dev/vdd
            life: alive
  volumes:
    "0":
      provider-id: 0d946edd-cdee-48df-b315-65cf091762fa
      storage: osd-devices/0
      attachments:
        machines:
          "4":
            device: vdd
            read-only: false
            life: alive
        units:
          ceph-osd/0:
            machine: "4"
            location: /dev/vdd
            life: alive
      pool: cinder
      size: 10240
      persistent: true
      life: alive
      status:
        current: attached
        since: 09 Jan 2019 15:13:21Z
    "1":
      provider-id: 6d5ad12f-88af-4e8d-831d-25c9cee343e7
      storage: osd-devices/1
      attachments:
        machines:
          "5":
            device: vdd
            read-only: false
            life: alive
        units:
          ceph-osd/1:
            machine: "5"
            location: /dev/vdd
            life: alive
      pool: cinder
      size: 10240
      persistent: true
      life: alive
      status:
        current: attached
        since: 09 Jan 2019 15:13:21Z
    "2":
      provider-id: 59b1c25a-4417-4c52-9be5-3684cc74806e
      storage: osd-devices/2
      attachments:
        machines:
          "6":
            device: vdd
            read-only: false
            life: alive
        units:
          ceph-osd/2:
            machine: "6"
            location: /dev/vdd
            life: alive
      pool: cinder
      size: 10240
      persistent: true
      life: alive
      status:
        current: attached
        since: 09 Jan 2019 15:13:19Z
controller:
  timestamp: 15:08:20Z
ubuntu@test:~$ source src/openstack-charm-testing/rcs/openrc
-bash: [: too many arguments
Using Keystone v2.0 API
/tmp/juju-exec254394858/script.sh: line 1: ceph-osd/0: No such file or directory
/tmp/juju-exec962800830/script.sh: line 1: ceph-osd/0: No such file or directory

Revision history for this message
Frode Nordahl (fnordahl) wrote :
Changed in openstack-bundles:
importance: Undecided → Medium
assignee: nobody → Frode Nordahl (fnordahl)
status: New → Fix Committed
milestone: none → 19.04
status: Fix Committed → In Progress
status: In Progress → Fix Committed
David Ames (thedac)
Changed in openstack-bundles:
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.