From d6be75bbaea363766767d337db2adc644ea83bdf Mon Sep 17 00:00:00 2001 From: Bilal Baqar Date: Sun, 16 Aug 2015 12:08:38 -0700 Subject: [PATCH] Removing PLUMgrid restart on LCM Key post --- hooks/pg_gw_hooks.py | 3 +++ hooks/pg_gw_utils.py | 1 + unit_tests/test_pg_gw_hooks.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hooks/pg_gw_hooks.py b/hooks/pg_gw_hooks.py index c2d314b..e6de5a1 100755 --- a/hooks/pg_gw_hooks.py +++ b/hooks/pg_gw_hooks.py @@ -70,6 +70,9 @@ def config_changed(): This hook is run when a config parameter is changed. It also runs on node reboot. ''' + if add_lcm_key(): + log("PLUMgrid LCM Key added") + return 1 stop_pg() configure_sources(update=True) pkgs = determine_packages() diff --git a/hooks/pg_gw_utils.py b/hooks/pg_gw_utils.py index a1732d3..496a447 100644 --- a/hooks/pg_gw_utils.py +++ b/hooks/pg_gw_utils.py @@ -212,3 +212,4 @@ def add_lcm_key(): fa.write(key) fa.write('\n') fa.close() + return 1 diff --git a/unit_tests/test_pg_gw_hooks.py b/unit_tests/test_pg_gw_hooks.py index 3bbd29b..5965375 100644 --- a/unit_tests/test_pg_gw_hooks.py +++ b/unit_tests/test_pg_gw_hooks.py @@ -71,6 +71,7 @@ class PGGwHooksTests(CharmTestCase): def test_config_changed_hook(self): _pkgs = ['plumgrid-lxc', 'iovisor-dkms'] + self.add_lcm_key.return_value = 0 self.determine_packages.return_value = [_pkgs] self._call_hook('config-changed') self.stop_pg.assert_called_with() @@ -82,7 +83,6 @@ class PGGwHooksTests(CharmTestCase): self.load_iovisor.assert_called_with() self.ensure_mtu.assert_called_with() self.ensure_files.assert_called_with() - self.add_lcm_key.assert_called_with() self.CONFIGS.write_all.assert_called_with() self.restart_pg.assert_called_with()