py3: switch to json based data from principle charms

Bug #1741304 reported by James Page
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack HA Cluster Charm
Fix Released
High
James Page
OpenStack Neutron API Charm
Fix Released
High
James Page

Bug Description

In order to ensure that consistent data is presented from its principle charm when running under py3, we need to use a better serialization format that provided by AST for the passing of pacemaker configuration.

JSON provides the ability to consistently sort keys; in order to support upgrades we need to try to parse 'json_' prefixed data key versions first, and then fallback to ast parsed current key sets if not detected.

Principle charms can then switch safely to the new serialization format.

James Page (james-page)
Changed in charm-hacluster:
status: New → Triaged
importance: Undecided → High
Revision history for this message
James Page (james-page) wrote :
Changed in charm-neutron-api:
status: New → In Progress
importance: Undecided → High
assignee: nobody → James Page (james-page)
Changed in charm-hacluster:
assignee: nobody → James Page (james-page)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-hacluster (master)

Reviewed: https://review.openstack.org/531204
Committed: https://git.openstack.org/cgit/openstack/charm-hacluster/commit/?id=22d30c2294cffdb5c21361a1c6d102f916b0d205
Submitter: Zuul
Branch: master

commit 22d30c2294cffdb5c21361a1c6d102f916b0d205
Author: James Page <email address hidden>
Date: Thu Jan 4 18:01:28 2018 +0000

    Support use of json for relation data

    In order to provide consistent presentation of relation data
    in Python 3 based charms, support passing of data using JSON
    format which ensures that data on relations won't continually
    change due to non-deterministic dictionary iteration in py3.

    Change-Id: I364a60ca7b91327fe88ee729cf49ff8ab3f5e2b6
    Closes-Bug: 1741304

Changed in charm-hacluster:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-neutron-api (master)

Reviewed: https://review.openstack.org/531207
Committed: https://git.openstack.org/cgit/openstack/charm-neutron-api/commit/?id=852d1f2f3ae4fefd19f0b2e4c02aaf5539cb7f99
Submitter: Zuul
Branch: master

commit 852d1f2f3ae4fefd19f0b2e4c02aaf5539cb7f99
Author: James Page <email address hidden>
Date: Thu Jan 4 18:12:14 2018 +0000

    Pass data to hacluster charm using JSON

    Encode dicts passed to hacluster charm using JSON serialization,
    supporting consistent data presentation under Python 3 where
    dict key iteration is non-deterministic.

    This is supported by prefixing json based data items with 'json_'
    and encoding with keys sorted.

    The charm will also clear any unprefixed based data items for
    upgrades.

    Change-Id: I21c6acff4a4a22cbcc5e6ea4e78394ce076e79d9
    Closes-Bug: 1741304
    Depends-On: I364a60ca7b91327fe88ee729cf49ff8ab3f5e2b6

Changed in charm-neutron-api:
status: In Progress → Fix Committed
James Page (james-page)
Changed in charm-hacluster:
milestone: none → 18.02
Changed in charm-neutron-api:
milestone: none → 18.02
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-hacluster (stable/17.11)

Fix proposed to branch: stable/17.11
Review: https://review.openstack.org/545521

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-hacluster (stable/17.11)

Reviewed: https://review.openstack.org/545521
Committed: https://git.openstack.org/cgit/openstack/charm-hacluster/commit/?id=ff1625985915189f59a68f6c2d654d5953844a3b
Submitter: Zuul
Branch: stable/17.11

commit ff1625985915189f59a68f6c2d654d5953844a3b
Author: James Page <email address hidden>
Date: Thu Jan 4 18:01:28 2018 +0000

    Support use of json for relation data

    In order to provide consistent presentation of relation data
    in Python 3 based charms, support passing of data using JSON
    format which ensures that data on relations won't continually
    change due to non-deterministic dictionary iteration in py3.

    Change-Id: I364a60ca7b91327fe88ee729cf49ff8ab3f5e2b6
    Closes-Bug: 1741304
    (cherry picked from commit 22d30c2294cffdb5c21361a1c6d102f916b0d205)

Ryan Beisner (1chb1n)
Changed in charm-hacluster:
status: Fix Committed → Fix Released
Changed in charm-neutron-api:
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.