Merge lp://staging/~jjo/charms/trusty/nova-cloud-controller/fix-haproxy-cfg-for-neutron-api-lp1476394 into lp://staging/~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by JuanJo Ciarlante
Status: Merged
Merged at revision: 196
Proposed branch: lp://staging/~jjo/charms/trusty/nova-cloud-controller/fix-haproxy-cfg-for-neutron-api-lp1476394
Merge into: lp://staging/~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 33 lines (+9/-7)
1 file modified
hooks/nova_cc_context.py (+9/-7)
To merge this branch: bzr merge lp://staging/~jjo/charms/trusty/nova-cloud-controller/fix-haproxy-cfg-for-neutron-api-lp1476394
Reviewer Review Type Date Requested Status
Billy Olsen Needs Fixing
David Ames (community) Needs Information
OpenStack Charmers Pending
Review via email: mp+265341@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #6513 nova-cloud-controller-next for jjo mp265341
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/6513/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #6145 nova-cloud-controller-next for jjo mp265341
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/6145/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #5235 nova-cloud-controller-next for jjo mp265341
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/5235/

Revision history for this message
David Ames (thedac) wrote :

JuanJo,

Thanks for the bug report and the MP.

As I mentioned on IRC I would like the scenario that leads to haproxy config being incorrect. If you have a juju-deployer config or just a simple setup example I would appreciate it.

I suspect we are going to want to use if not relation_ids('neutron-api') rather than is_relation_made as it is slightly less stringent and my concern is this is potentially racey. The neutron-api relation may not yet exist when the HAProxy context is called.

Unfortunately, we had problems with serverstack so I was unable to test my theories.

review: Needs Information
Revision history for this message
Billy Olsen (billy-olsen) wrote :

I believe the scenario to recreate this would be to first deploy x nova-cloud-controller units in which the nova-cloud-controller is providing the neutron-api endpoint. When the dust settles from that phase, you'll have haproxy configuration for the local nova-cloud-controller.

Next, mix in the relation for the neutron-api w/ the nova-cloud-controller and the haproxy configuration should no longer contain the neutron-api configuration information in its own haproxy configuration since the nova-cloud-controller is no longer hosting that service.

Regarding using the is_relation_made method vs the relation_ids; I'm not entirely sure that splitting hairs on is_relation_made vs relation_ids is necessary since the default key set for is_relation_made is private-address which is part of the juju relation setup (afaiui) and as such if relation_ids exist then its likely the relation is made.

Revision history for this message
Billy Olsen (billy-olsen) wrote :

JuanJo, can we get a unit test to the effect of what this is testing?

review: Needs Fixing
Revision history for this message
David Ames (thedac) wrote :

I was able to recreate the issue with the current version of next. JuanJo's solution works well. Once there is a unit test in place this can be merged.

In the process I found a bug unrelated to/not caused by this MP https://bugs.launchpad.net/charms/+source/nova-cloud-controller/+bug/1479416

Revision history for this message
Liam Young (gnuoy) wrote :

I've added unit tests to this branch here: lp:~gnuoy/charms/trusty/nova-cloud-controller/fix-haproxy-cfg-for-neutron-api-lp1476394

I'll try and get that landed so it will supersede this branch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches