Merge lp://staging/~abentley/charms/trusty/apache2/apache2-ports into lp://staging/charms/trusty/apache2

Proposed by Aaron Bentley
Status: Merged
Approved by: David Britton
Approved revision: 63
Merged at revision: 59
Proposed branch: lp://staging/~abentley/charms/trusty/apache2/apache2-ports
Merge into: lp://staging/charms/trusty/apache2
Diff against target: 287 lines (+133/-21)
5 files modified
hooks/hooks.py (+56/-16)
hooks/tests/test_balancer_hook.py (+3/-3)
hooks/tests/test_config_changed.py (+4/-1)
hooks/tests/test_hooks.py (+65/-0)
hooks/tests/test_vhost_config_relation.py (+5/-1)
To merge this branch: bzr merge lp://staging/~abentley/charms/trusty/apache2/apache2-ports
Reviewer Review Type Date Requested Status
David Britton (community) Approve
Adam Israel (community) Approve
Review Queue (community) automated testing Needs Fixing
Review via email: mp+245740@code.staging.launchpad.net

Commit message

Unify port handling.

Description of the change

This branch unifies open-port/close-port handling. It is a prerequisite for apache2-website-interface support, which I will introduce in a follow-on branch.

Multiple configuration options may refer to the same port. For example, a vhost_http_template might refer to port 80 and so might a vhost-config relation. But they can have conflicting ideas about whether a port should be open. If the vhost-config has an empty template, port 80 will be closed, even though the vhost_http_template wants it open. And of course, there can be multiple vhost-configs with their own conflicting opinions.

This code unifies the port handling, so that it is done in a single place. If any configuration mechanism wants a paticular port open, it is open. Otherwise it is closed. It also records the current list of ports, so that future hook runs can detect when a port has changed, and close the old port.

To post a comment you must log in.
Revision history for this message
Review Queue (review-queue) wrote :

This items has failed automated testing! Results available here http://reports.vapour.ws/charm-tests/charm-bundle-test-10870-results

review: Needs Fixing (automated testing)
Revision history for this message
Aaron Bentley (abentley) wrote :

The automated test failures are a pre-existing issue:
http://reports.vapour.ws/charm-tests/charm-bundle-test-10700-results

They are not caused by my changes.

Revision history for this message
Adam Israel (aisrael) wrote :

Hi Aaron,

I had the opportunity to review this MP today, and I agree that the failing tests are unrelated to your changes. LGTM. +1

review: Approve
Revision history for this message
David Britton (dpb) wrote :

This looks great, Aaron.

Thanks! +1

review: Approve

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

to all changes: