server: Add early escapes to simplify logic
Add a couple early escapes to the bus_handler method.
Tested: Manually verified mapper content is the same after service
discovery.
Change-Id: I9c0e08022176345797fd74809770ddfdfeffe904
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/obmc/mapper/server.py b/obmc/mapper/server.py
index e1f3af2..11e93ed 100644
--- a/obmc/mapper/server.py
+++ b/obmc/mapper/server.py
@@ -394,13 +394,13 @@
path, owner, old=old, new=[])
def bus_handler(self, owned_name, old, new):
- valid = False
- if not obmc.dbuslib.bindings.is_unique(owned_name):
- valid = self.bus_normalize(owned_name)
+ if obmc.dbuslib.bindings.is_unique(owned_name) or \
+ owned_name == obmc.mapper.MAPPER_NAME:
+ return
- if valid and new:
+ if new:
self.process_new_owner(owned_name, new)
- if valid and old:
+ if old:
# discard any unhandled signals
# or in progress discovery
if old in self.defer_signals: