Fix bug in mapper for associations KeyError
In the active software image associations, the associations
property is initially empty, associations are added as images
become active. Remove the check for an empty associations
property. This check was causing the 'associations' dict
object to not be created, which was causing the KeyError.
Resolves openbmc/openbmc#2263
Change-Id: Ibc11d92d7bb99d22fbb31ed7b6196165431cee55
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/obmc/mapper/server.py b/obmc/mapper/server.py
index f5370f0..e09bbbf 100644
--- a/obmc/mapper/server.py
+++ b/obmc/mapper/server.py
@@ -87,8 +87,7 @@
try:
iface = obmc.dbuslib.enums.OBMC_ASSOCIATIONS_IFACE
self.assoc_pending.remove(path)
- if associations:
- self.results[path][iface]['associations'] = associations
+ self.results[path][iface]['associations'] = associations
except Exception, e:
error_callback(service, path, e)
return None