summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Metadata.py
diff options
context:
space:
mode:
authorMichael Fenn <fennm@deshawresearch.com>2013-08-05 21:19:41 -0400
committerMichael Fenn <fennm@deshawresearch.com>2013-08-05 21:19:41 -0400
commit936b8aa2b6329ddf45c1032171c16d0eaea99b37 (patch)
tree5de09d9c0bf8aa3add70b3ca48d2027c79414e1e /src/lib/Bcfg2/Server/Plugins/Metadata.py
parent27cdcd93023d5979d4c7724ca8c141331bae08e2 (diff)
downloadbcfg2-936b8aa2b6329ddf45c1032171c16d0eaea99b37.tar.gz
bcfg2-936b8aa2b6329ddf45c1032171c16d0eaea99b37.tar.bz2
bcfg2-936b8aa2b6329ddf45c1032171c16d0eaea99b37.zip
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
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Metadata.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Metadata.py12
1 files changed, 6 insertions, 6 deletions
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))