grenade fails resource provider inventory check with python3

Bug #1803312 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grenade
Fix Released
Undecided
Matt Riedemann

Bug Description

I have a change proposed to add a python3-specific grenade job:

https://review.openstack.org/#/c/617661/

But it fails because the column order from the "openstack resource provider inventory list" command output is random on py3 which results in the expected value not matching the stored value:

http://logs.openstack.org/61/617661/2/check/grenade-py3/8490018/logs/grenade.sh.txt.gz#_2018-11-13_14_37_31_064

2018-11-13 14:37:28.139 | + /opt/stack/new/grenade/projects/60_nova/resources.sh:create:146 : for key in '$NOVA_VERIFY_RESOURCE_CLASSES'
2018-11-13 14:37:28.143 | ++ /opt/stack/new/grenade/projects/60_nova/resources.sh:create:147 : _get_inventory_value VCPU
2018-11-13 14:37:28.146 | ++ /opt/stack/new/grenade/projects/60_nova/resources.sh:_get_inventory_value:51 : local key
2018-11-13 14:37:28.151 | ++ /opt/stack/new/grenade/projects/60_nova/resources.sh:_get_inventory_value:52 : local provider
2018-11-13 14:37:28.154 | ++ /opt/stack/new/grenade/projects/60_nova/resources.sh:_get_inventory_value:54 : key=VCPU
2018-11-13 14:37:28.159 | +++ /opt/stack/new/grenade/projects/60_nova/resources.sh:_get_inventory_value:57 : head -n1
2018-11-13 14:37:28.160 | +++ /opt/stack/new/grenade/projects/60_nova/resources.sh:_get_inventory_value:57 : openstack resource provider list -f value
2018-11-13 14:37:28.168 | +++ /opt/stack/new/grenade/projects/60_nova/resources.sh:_get_inventory_value:57 : cut -d ' ' -f 1
2018-11-13 14:37:29.730 | ++ /opt/stack/new/grenade/projects/60_nova/resources.sh:_get_inventory_value:57 : provider=924e041b-3f09-4894-a06a-caf22eb31ba6
2018-11-13 14:37:29.734 | ++ /opt/stack/new/grenade/projects/60_nova/resources.sh:_get_inventory_value:60 : grep '^VCPU'
2018-11-13 14:37:29.734 | ++ /opt/stack/new/grenade/projects/60_nova/resources.sh:_get_inventory_value:60 : openstack resource provider inventory list -f value 924e041b-3f09-4894-a06a-caf22eb31ba6
2018-11-13 14:37:29.743 | ++ /opt/stack/new/grenade/projects/60_nova/resources.sh:_get_inventory_value:60 : cut -d ' ' -f 3
2018-11-13 14:37:31.052 | + /opt/stack/new/grenade/projects/60_nova/resources.sh:create:147 : resource_save nova nova_inventory_VCPU 0
2018-11-13 14:37:31.055 | + /opt/stack/new/grenade/inc/plugin:resource_save:135 : local project=nova
2018-11-13 14:37:31.058 | + /opt/stack/new/grenade/inc/plugin:resource_save:136 : local key=nova_inventory_VCPU
2018-11-13 14:37:31.061 | + /opt/stack/new/grenade/inc/plugin:resource_save:137 : local value=0
2018-11-13 14:37:31.064 | + /opt/stack/new/grenade/inc/plugin:resource_save:138 : iniset /opt/stack/save/grenade_db.ini nova nova_inventory_VCPU 0

We can fix this by using the -c option to get the specific inventory value we care about.

Matt Riedemann (mriedem)
Changed in grenade:
assignee: nobody → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to grenade (master)

Fix proposed to branch: master
Review: https://review.openstack.org/617914

Changed in grenade:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to grenade (master)

Reviewed: https://review.openstack.org/617914
Committed: https://git.openstack.org/cgit/openstack-dev/grenade/commit/?id=8afd7beb079dc4d9bf5e4e69c13a8c8a8bd060d3
Submitter: Zuul
Branch: master

commit 8afd7beb079dc4d9bf5e4e69c13a8c8a8bd060d3
Author: Matt Riedemann <email address hidden>
Date: Wed Nov 14 04:07:59 2018 -0500

    Use openstack resource provider inventory show to get inventory

    Under python3, the output of the openstack resource provider
    inventory list command is random which breaks how the
    _get_inventory_value function is used to store and verify
    inventory before and after the upgrade.

    This change uses the "openstack resource provider inventory show"
    command to target the specific resource class and column value (total)
    so we don't have to worry about sort order.

    While in here, a comment is left about why we can't do the
    same for getting the resource class allocation value.

    Change-Id: I1e8dadae631bee87628c5b5390609deb8a1a71e5
    Closes-Bug: #1803312

Changed in grenade:
status: In Progress → 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.