From 44c900958f9ab9d7e5c1c104b53eb651e1e444c7 Mon Sep 17 00:00:00 2001 From: Billy Olsen Date: Tue, 27 Feb 2018 06:32:12 -0700 Subject: [PATCH] Reassign init and delete services instead of extend The CRM.delete_services(...) and CRM.init_services(...) methods update the internal list used to communicate with the hacluster charm. This causes the list to continuously grow, which causes the data in the hacluster relation to change. The constantly updated relation change causes hooks to fire unintentionally. Change-Id: Ica823027b1a3fafe277d862fae0a3cdcf5907774 Partial-Bug: #1737776 --- common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.py b/common.py index 3d63755..036f064 100644 --- a/common.py +++ b/common.py @@ -300,7 +300,7 @@ class CRM(dict): -------- http://crmsh.github.io/man/#cmdhelp_configure_delete """ - self['delete_resources'].extend(resources) + self['delete_resources'] = resources def init_services(self, *resources): """Specifies that the service(s) is an init or upstart service. @@ -317,7 +317,7 @@ class CRM(dict): ------- None """ - self['init_services'].extend(resources) + self['init_services'] = resources def ms(self, name, resource, description=None, **kwargs): """Create a master/slave resource type.