Adding upgrade-charm hook

This commit is contained in:
Bilal Baqar 2016-03-11 02:27:46 -08:00
parent bf85578035
commit 395eaafb5c
3 changed files with 7 additions and 8 deletions

View File

@ -100,6 +100,11 @@ def config_changed():
restart_pg()
@hooks.hook('upgrade-charm')
def upgrade_charm():
load_iptables()
@hooks.hook('stop')
def stop():
'''

View File

@ -338,14 +338,7 @@ def load_iptables():
_exec_cmd(['sudo', 'iptables', '-A', 'INPUT', '-p', 'udp', '-j',
'ACCEPT', '-s', network, '-d', network,
'-m', 'state', '--state', 'NEW'])
_exec_cmd(['sudo', 'iptables', '-I', 'INPUT', '-s', network,
'-d', '224.0.0.18/32', '-j', 'ACCEPT'])
_exec_cmd(['sudo', 'iptables', '-I', 'INPUT', '-p', 'vrrp', '-j',
'ACCEPT'])
_exec_cmd(['sudo', 'iptables', '-A', 'INPUT', '-p', 'tcp', '-j',
'ACCEPT', '-d', config('plumgrid-virtual-ip'), '-m',
'state', '--state', 'NEW'])
apt_install('iptables-persistent')
apt_install('iptables-persistent')
def get_cidr_from_iface(interface):

1
hooks/upgrade-charm Symbolic link
View File

@ -0,0 +1 @@
pg_gw_hooks.py