Merge lp://staging/~freyes/charms/trusty/memcached/python-rewrite into lp://staging/charms/trusty/memcached

Proposed by Felipe Reyes
Status: Superseded
Proposed branch: lp://staging/~freyes/charms/trusty/memcached/python-rewrite
Merge into: lp://staging/charms/trusty/memcached
Diff against target: 3688 lines (+3159/-260)
35 files modified
.bzrignore (+4/-0)
Makefile (+30/-0)
charm-helpers.yaml (+5/-0)
config.yaml (+6/-6)
hooks/cache-relation-joined (+0/-9)
hooks/charmhelpers/core/fstab.py (+118/-0)
hooks/charmhelpers/core/hookenv.py (+540/-0)
hooks/charmhelpers/core/host.py (+396/-0)
hooks/charmhelpers/core/services/__init__.py (+2/-0)
hooks/charmhelpers/core/services/base.py (+313/-0)
hooks/charmhelpers/core/services/helpers.py (+243/-0)
hooks/charmhelpers/core/sysctl.py (+34/-0)
hooks/charmhelpers/core/templating.py (+52/-0)
hooks/charmhelpers/fetch/__init__.py (+416/-0)
hooks/charmhelpers/fetch/archiveurl.py (+145/-0)
hooks/charmhelpers/fetch/bzrurl.py (+54/-0)
hooks/charmhelpers/fetch/giturl.py (+48/-0)
hooks/config-changed (+0/-155)
hooks/install (+0/-20)
hooks/memcached_hooks.py (+216/-0)
hooks/memcached_utils.py (+43/-0)
hooks/munin-relation-changed (+0/-29)
hooks/nrpe-external-master-relation-changed (+0/-19)
hooks/start (+0/-2)
hooks/stop (+0/-3)
hooks/upgrade-charm (+0/-4)
metadata.yaml (+1/-1)
templates/memcached.conf (+62/-0)
templates/munin-node.conf (+66/-0)
templates/nrpe_check_memcached.cfg.tmpl (+1/-1)
templates/nrpe_export.cfg.tmpl (+3/-3)
tests/10_deploy_test.py (+9/-8)
unit_tests/__init__.py (+2/-0)
unit_tests/test_memcached_hooks.py (+228/-0)
unit_tests/test_utils.py (+122/-0)
To merge this branch: bzr merge lp://staging/~freyes/charms/trusty/memcached/python-rewrite
Reviewer Review Type Date Requested Status
Jorge Niedbalski (community) Needs Fixing
Review via email: mp+243407@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2014-12-02.

Description of the change

Dear Charmers,

This MP is a rewrite in python to leverage charmhelpers and secure memcached service using ufw rules to only allow access from machines related to the service.

Summary of changes:

* Drop all the bash in favor of python
* Added unit tests
* Changed config type to boolean of following keys:
  * disable-auto-cleanup
  * disable-cas
  * disable-large-pages
* Use ufw to secure memcached[0]

[0] root@ubuntu:~# ufw status # before relating memcache with mediawiki
Status: active

To Action From
-- ------ ----
22 ALLOW Anywhere
4949 ALLOW Anywhere
22 (v6) ALLOW Anywhere (v6)
4949 (v6) ALLOW Anywhere (v6)
21/tcp ALLOW ::1

root@ubuntu:~# ufw status # after juju add-relation memcached mediawiki
Status: active

To Action From
-- ------ ----
22 ALLOW Anywhere
4949 ALLOW Anywhere
11211/tcp ALLOW 192.168.0.120
22 (v6) ALLOW Anywhere (v6)
4949 (v6) ALLOW Anywhere (v6)

To post a comment you must log in.
Revision history for this message
Jorge Niedbalski (niedbalski) wrote :

Hello Felipe,

Thanks for this contribution. I made some inline comments, required to be fixed. Also i have a few suggestions for improving.

On the lint side,

- Remove the 'tags' section on the metadata.yaml file.
- Add the categories: ["system"] on the metadata.yaml file.

On the test side,

- Remove the pre_install_hooks code.
- Add test coverage for the method cache_relation_departed
- Add test coverage for the method upgrade_charm

On the memcache_utils file.

- Please instead of create your own template rendering method, please see:
hooks/charmhelpers/core/templating.py
- Add test coverage for method revoke_access

review: Needs Fixing
82. By Felipe Reyes

Drop homebrew templating in favor of charmhelpers.core.templating.render()

83. By Felipe Reyes

Set tags to 'system' instead of 'applications'

84. By Felipe Reyes

Removed pre_install_hooks()

85. By Felipe Reyes

Added test for cache-relation-departed hook

Also extended cache-relation-joined to check firewall rules were applied

86. By Felipe Reyes

Add test for upgrade-charm hook

87. By Felipe Reyes

Re-synced charm-helpers, added contrib.network module

88. By Felipe Reyes

Dropped homebrew code to manage ufw in favor of charmhelpers

89. By Felipe Reyes

sync charm-helpers

90. By Felipe Reyes

Fix amulet tests

- Use trusty series while creating deployment
- Check tcp-port is closed, then open it and connect to check memcached
  is functioning.

91. By Felipe Reyes

Update Makefile with new targets and use virtualenv to run tests

92. By Felipe Reyes

Add missing test dependencies

93. By Felipe Reyes

Add flake8 to test_requirements

Unmerged revisions

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