server: Handle short lived bus name owners
A short lived process may claim a name and then exit before
the mapper calls GetNameOwner on it. Add code to tolerate
this.
Change-Id: I2cf81713da4c83605c636d09087a18c651187aec
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/obmc/mapper/server.py b/obmc/mapper/server.py
index 2944ddf..cf05866 100644
--- a/obmc/mapper/server.py
+++ b/obmc/mapper/server.py
@@ -487,12 +487,17 @@
return match
def discover(self, owners=[]):
+ def get_owner(name):
+ try:
+ return (name, self.bus.get_name_owner(name))
+ except:
+ traceback.print_exception(*sys.exc_info())
+
if not owners:
owned_names = filter(
lambda x: not obmc.dbuslib.bindings.is_unique(x),
self.bus.list_names())
- owners = [self.bus.get_name_owner(x) for x in owned_names]
- owners = zip(owned_names, owners)
+ owners = filter(bool, [get_owner(name) for name in owned_names])
for owned_name, o in owners:
self.bus_map[o] = owned_name
self.defer_signals[o] = []