From 936b8aa2b6329ddf45c1032171c16d0eaea99b37 Mon Sep 17 00:00:00 2001 From: Michael Fenn Date: Mon, 5 Aug 2013 21:19:41 -0400 Subject: Make updating the structures conditional on profile changing Based on the expectations of the tests, I am reasonably confident that updating the in memory structures is logically part of changing the client's profile so I put it in the if block --- src/lib/Bcfg2/Server/Plugins/Metadata.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Bcfg2/Server/Plugins/Metadata.py b/src/lib/Bcfg2/Server/Plugins/Metadata.py index 0e2277239..e62b3f77f 100644 --- a/src/lib/Bcfg2/Server/Plugins/Metadata.py +++ b/src/lib/Bcfg2/Server/Plugins/Metadata.py @@ -984,12 +984,12 @@ class Metadata(Bcfg2.Server.Plugin.Metadata, self.logger.info("Changing %s profile from %s to %s" % (client, profiles, profile)) self.update_client(client, dict(profile=profile)) - if client in self.clientgroups: - for prof in profiles: - self.clientgroups[client].remove(prof) - self.clientgroups[client].append(profile) - else: - self.clientgroups[client] = [profile] + if client in self.clientgroups: + for prof in profiles: + self.clientgroups[client].remove(prof) + self.clientgroups[client].append(profile) + else: + self.clientgroups[client] = [profile] else: self.logger.info("Creating new client: %s, profile %s" % (client, profile)) -- cgit v1.2.3-1-g7c22