diff --git a/hooks/pg_gw_hooks.py b/hooks/pg_gw_hooks.py index a64030b..5b37e89 100755 --- a/hooks/pg_gw_hooks.py +++ b/hooks/pg_gw_hooks.py @@ -100,6 +100,11 @@ def config_changed(): restart_pg() +@hooks.hook('upgrade-charm') +def upgrade_charm(): + load_iptables() + + @hooks.hook('stop') def stop(): ''' diff --git a/hooks/pg_gw_utils.py b/hooks/pg_gw_utils.py index 47577de..00c3402 100644 --- a/hooks/pg_gw_utils.py +++ b/hooks/pg_gw_utils.py @@ -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): diff --git a/hooks/upgrade-charm b/hooks/upgrade-charm new file mode 120000 index 0000000..3aec9ba --- /dev/null +++ b/hooks/upgrade-charm @@ -0,0 +1 @@ +pg_gw_hooks.py \ No newline at end of file