~freyes/charms/trusty/memcached/lp1636519

« back to all changes in this revision

Viewing changes to hooks/memcached_hooks.py

  • Committer: Jorge Niedbalski
  • Author(s): Felipe Reyes
  • Date: 2015-01-27 20:10:35 UTC
  • mfrom: (62.1.1 memcached.apt-get_update)
  • Revision ID: jorge.niedbalski@canonical.com-20150127201035-71kq0yk36qfk7pfd
[freyes, r=niedbalski] Fixes bug LP: #1403567

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    service_start,
26
26
    service_stop,
27
27
)
28
 
from charmhelpers.fetch import apt_install
 
28
from charmhelpers.fetch import apt_install, apt_update
29
29
from charmhelpers.contrib.network import ufw
30
30
import memcached_utils
31
31
 
47
47
 
48
48
@hooks.hook('install')
49
49
def install():
 
50
    apt_update(fatal=True)
50
51
    apt_install(["memcached", "python-cheetah", "python-memcache"], fatal=True)
51
52
 
52
53
    with open(ETC_DEFAULT_MEMCACHED, 'w') as f:
159
160
    ufw.service('4949', 'open')
160
161
 
161
162
    # make sure it's instaled
 
163
    apt_update(fatal=True)
162
164
    apt_install(['munin-node'], fatal=True)
163
165
    configs = {'munin_server': munin_server_ip}
164
166
    templating.render('munin-node.conf', ETC_MUNIN_NODE_CONF, configs)
170
172
def nrpe_external_master_relation_changed():
171
173
 
172
174
    # make sure it's installed
 
175
    apt_update(fatal=True)
173
176
    apt_install(['nagios-nrpe-server'], fatal=True)
174
177
    ufw.service('5666', 'open')
175
178