Merge lp:~canonical-sysadmins/charms/trusty/apache2/apache2-storage into lp:charms/trusty/apache2

Proposed by Jacek Nykis on 2016-06-29
Status: Needs review
Proposed branch: lp:~canonical-sysadmins/charms/trusty/apache2/apache2-storage
Merge into: lp:charms/trusty/apache2
Diff against target: 61 lines (+20/-1)
4 files modified
README.md (+4/-0)
config.yaml (+6/-0)
hooks/hooks.py (+3/-1)
metadata.yaml (+7/-0)
To merge this branch: bzr merge lp:~canonical-sysadmins/charms/trusty/apache2/apache2-storage
Reviewer Review Type Date Requested Status
Review Queue (community) automated testing Needs Fixing on 2016-09-11
Review Queue (community) automated testing Needs Fixing on 2016-09-10
Pete Vander Giessen Needs Fixing on 2016-08-04
charmers 2016-06-29 Pending
Review via email: mp+298617@code.launchpad.net

Description of the Change

This branch adds basic juju storage support to the apache2 charm. Tested with local provider (noop) and in OpenStack

To post a comment you must log in.
75. By Chris Stratford on 2016-07-04

[jacek,r=chriss] Add "extra_ports" configuration option

Pete Vander Giessen (petevg) wrote :

I ran into two failures when running bundletester on this charm:

1) "make lint" fails due to a missing flake8 dependency.
2) "make test" fails, as the new code breaks the mocking strategy for one of the existing tests.

Specifically, hooks.tests.ConfigChangedTest.test_config_changed_empty_site_dir fails.

This is because the test patches out config_get, and has it return a mock config object. You can fix the test by doing one of the following:

1) Make the mock more complex, so that you can do config_get("foo"), and get back what you expect.
2) Change line 42 of hooks.py to something like the following:

    set([int(p) for p in config_get()['extra_ports'].split()])

(You may then need to populate 'extra_ports' in the mock config with a list suitable for testing purposes.)

review: Needs Fixing
Pete Vander Giessen (petevg) wrote :

Testing failures aside, I was able to deploy this manually without errors, and the code looks solid.
Once "make test" passes, I am +1 on merging this.

Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws/job/charm-bundle-test-aws/5013/

review: Needs Fixing (automated testing)
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws/job/charm-bundle-test-lxc/4810/

review: Needs Fixing (automated testing)
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws/job/charm-bundle-test-aws/5021/

review: Needs Fixing (automated testing)
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws/job/charm-bundle-test-aws/5028/

review: Needs Fixing (automated testing)
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws/job/charm-bundle-test-lxc/4817/

review: Needs Fixing (automated testing)
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws/job/charm-bundle-test-lxc/4822/

review: Needs Fixing (automated testing)
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws/job/charm-bundle-test-aws/5036/

review: Needs Fixing (automated testing)

Unmerged revisions

75. By Chris Stratford on 2016-07-04

[jacek,r=chriss] Add "extra_ports" configuration option

74. By Jacek Nykis on 2016-06-29

Updated README.md

73. By Jacek Nykis on 2016-06-24

Add basic storage support

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2016-01-15 22:59:50 +0000
3+++ README.md 2016-07-04 12:12:11 +0000
4@@ -36,6 +36,10 @@
5 ... then to perform a deployment execute the following steps:
6
7 juju deploy --repository=charms local:apache2
8+Or to deploy with extra storage volume:
9+ juju deploy --repository=charms local:apache2 --storage srv=150G
10+
11+Next set apache vhost template:
12 juju set apache2 "vhost_http_template=$(base64 < http_vhost.tmpl)"
13
14
15
16=== modified file 'config.yaml'
17--- config.yaml 2016-01-19 20:45:41 +0000
18+++ config.yaml 2016-07-04 12:12:11 +0000
19@@ -15,6 +15,12 @@
20 type: string
21 default: ''
22 description: Additional custom variables for the vhost templating, in python dict format
23+ extra_ports:
24+ type: string
25+ default: ''
26+ description: |
27+ Space separated list of additional ports to open. Useful when http or https template
28+ contains "Listen" stanzas
29 enable_modules:
30 type: string
31 default: ''
32
33=== modified file 'hooks/hooks.py'
34--- hooks/hooks.py 2016-02-25 20:46:58 +0000
35+++ hooks/hooks.py 2016-07-04 12:12:11 +0000
36@@ -640,7 +640,9 @@
37 apache_websites.write_configs()
38 apache_websites.enable_sites()
39 apache_websites.configure_extra_ports()
40- all_ports = apache_websites.list_enabled_ports()
41+ relation_ports = apache_websites.list_enabled_ports()
42+ config_ports = set([int(p) for p in config_get('extra_ports').split()])
43+ all_ports = relation_ports | config_ports
44 enable_mpm(config_data)
45 # XXX we only configure the worker mpm?
46 create_mpm_workerfile()
47
48=== modified file 'metadata.yaml'
49--- metadata.yaml 2015-11-20 21:39:49 +0000
50+++ metadata.yaml 2016-07-04 12:12:11 +0000
51@@ -34,3 +34,10 @@
52 interface: syslog
53 vhost-config:
54 interface: apache-vhost-config
55+storage:
56+ srv:
57+ type: filesystem
58+ description: Srv storage
59+ location: /srv
60+ multiple:
61+ range: 0-1

Subscribers

People subscribed via source and target branches