From 296395c1667d7554532585de41cdeba774834bb9 Mon Sep 17 00:00:00 2001 From: Gunnar Mills Date: Wed, 6 Sep 2017 13:56:43 -0500 Subject: 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 --- .gitignore | 1 + obmc/mapper/server.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ea7c12a..62fefe1 100644 --- a/.gitignore +++ b/.gitignore @@ -107,4 +107,5 @@ stamp-h1 *.o m4/ mapper +!mapper/ setup.py 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 @@ def find_dbus_interfaces(conn, service, path, callback, error_callback, **kw): 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 -- cgit v1.2.1