Unpredictable usernames when using defining multiple endpoints

Bug #1739409 reported by Liam Young
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Keystone Charm
Fix Released
Medium
Liam Young
OpenStack Neutron Gateway Charm
Fix Released
Undecided
Dmitrii Shcherbakov
OpenStack Nova Cloud Controller Charm
Fix Released
Medium
Liam Young

Bug Description

The trusty icehouse nova-cloud-controller amulet tests started failing with *1:

DEBUG:runner:2017-12-18 13:18:27,837 _validate_dict_data DEBUG: expected: {'admin_token': 'ubuntutesting', 'auth_port': '35357', 'auth_protocol': 'http', 'auth_host': <bound method NovaOpenStackAmuletUtils.valid_ip of <basic_deployment.NovaOpenStackAmuletUtils object at 0x7f695809fd10>>, 'service_username': 's3_ec2_nova', 'service_tenant_id': <bound method NovaOpenStackAmuletUtils.not_null of <basic_deployment.NovaOpenStackAmuletUtils object at 0x7f695809fd10>>, 'service_protocol': 'http', 'service_tenant': 'services', 'service_password': <bound method NovaOpenStackAmuletUtils.not_null of <basic_deployment.NovaOpenStackAmuletUtils object at 0x7f695809fd10>>, 'service_port': '5000', 'private-address': <bound method NovaOpenStackAmuletUtils.valid_ip of <basic_deployment.NovaOpenStackAmuletUtils object at 0x7f695809fd10>>, 'service_host': <bound method NovaOpenStackAmuletUtils.valid_ip of <basic_deployment.NovaOpenStackAmuletUtils object at 0x7f695809fd10>>}
DEBUG:runner:unexpected relation data in keystone identity-service - service_username:s3_nova_ec2

Looking at that output: s3_ec2_nova != s3_nova_ec2

I can't figure out what triggered this to start happening or why it only seems to happen in osci but either way it exposed that the service username for multi endpoints is constructed by iterating over the dictionary of settings from the remote unit and adding each service name to the service username. *2

The charm should not rely on the key order of an unordered object.

*1 https://openstack-ci-reports.ubuntu.com/artifacts/test_charm_pipeline_amulet_full/openstack/charm-nova-cloud-controller/527133/4/979/consoleText.test_charm_amulet_full_1695.txt
*2 https://github.com/openstack/charm-keystone/blob/master/hooks/keystone_utils.py#L2110

Liam Young (gnuoy)
Changed in charm-keystone:
status: New → Confirmed
Changed in charm-nova-cloud-controller:
status: New → Confirmed
Changed in charm-keystone:
importance: Undecided → Medium
Changed in charm-nova-cloud-controller:
importance: Undecided → Medium
Changed in charm-keystone:
assignee: nobody → Liam Young (gnuoy)
Changed in charm-nova-cloud-controller:
assignee: nobody → Liam Young (gnuoy)
Changed in charm-keystone:
milestone: none → 18.02
Changed in charm-nova-cloud-controller:
milestone: none → 18.02
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-keystone (master)

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

Changed in charm-keystone:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-nova-cloud-controller (master)

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

Changed in charm-nova-cloud-controller:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-keystone (master)

Reviewed: https://review.openstack.org/529316
Committed: https://git.openstack.org/cgit/openstack/charm-keystone/commit/?id=ee6db34c16b49916d2d78ccefce92349f55ffb52
Submitter: Zuul
Branch: master

commit ee6db34c16b49916d2d78ccefce92349f55ffb52
Author: Liam Young <email address hidden>
Date: Wed Dec 20 13:45:24 2017 +0000

    Make usernames predictable for multi-endpoints

    Whenm generating a username associated with multiple charm the
    username was derived from the keys of an unordered dict making the
    username liable to change. This patch sorts the keys and makes the
    username stable.

    Change-Id: I0f857d7c2d5c4abf4843bc3fe1a9848164048fe2
    Closes-Bug: #1739409

Changed in charm-keystone:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-cloud-controller (master)

Reviewed: https://review.openstack.org/529319
Committed: https://git.openstack.org/cgit/openstack/charm-nova-cloud-controller/commit/?id=c837c1412fa9f703f6c4caba7f77646c28a6374f
Submitter: Zuul
Branch: master

commit c837c1412fa9f703f6c4caba7f77646c28a6374f
Author: Liam Young <email address hidden>
Date: Wed Dec 20 13:48:50 2017 +0000

    Update amulet tests for new s3/ec2/nova username

    Keystone now orders the elements of the username when constructing
    a username for multiple services. Update amulet to expect the
    new username (only actually affects icehouse).

    Change-Id: I6ac49b0a2782df2ebc8f3d1fe299dec3cc078d7c
    Closes-Bug: #1739409
    Depends-On: I0f857d7c2d5c4abf4843bc3fe1a9848164048fe2

Changed in charm-nova-cloud-controller:
status: In Progress → Fix Committed
Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

This nova-cc change breaks neutron-gateway amulet tests.

https://review.openstack.org/#/c/541815/1

Added neutron-gateway here as its tests need to be updated as well.

Changed in charm-neutron-gateway:
assignee: nobody → Dmitrii Shcherbakov (dmitriis)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-neutron-gateway (master)

Reviewed: https://review.openstack.org/541905
Committed: https://git.openstack.org/cgit/openstack/charm-neutron-gateway/commit/?id=07baa057885050fcf1ef93749490427c730a6b2f
Submitter: Zuul
Branch: master

commit 07baa057885050fcf1ef93749490427c730a6b2f
Author: Dmitrii Shcherbakov <email address hidden>
Date: Thu Feb 8 00:03:11 2018 +0300

    Modify amulet tests to reflect nova-cc change

    https://review.openstack.org/#/c/541815/1 mismatched actual/expected
    relation data results in a test failure.

    Change-Id: I967602fb6c07c7dbc09c03aab8623d124df570cd
    Closes-Bug: #1739409
    Depends-On: I0f857d7c2d5c4abf4843bc3fe1a9848164048fe2

Changed in charm-neutron-gateway:
status: In Progress → Fix Committed
James Page (james-page)
Changed in charm-neutron-gateway:
milestone: none → 18.02
Ryan Beisner (1chb1n)
Changed in charm-keystone:
status: Fix Committed → Fix Released
Changed in charm-nova-cloud-controller:
status: Fix Committed → Fix Released
Ryan Beisner (1chb1n)
Changed in charm-neutron-gateway:
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.