Perform one retry on any discovery failure

The discovery phase of mapper is very CPU intensive on the BMC.
Situations have arisen, especially on BMC resets with the host
up, where a timeout occurs when mapper is discovering an object
on the dbus. The effects of mapper not discovering an object
can have large impacts to the system.

Testing: Validated in QEMU that the retry path was hit and the
retry successfully discovered the object. Verified on a witherspoon
that the retry path was hit and was successful.

Change-Id: I9f05a635c27af744a9deb882deb748804d6ee660
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/obmc/mapper/server.py b/obmc/mapper/server.py
index aa4c1e3..a6df224 100644
--- a/obmc/mapper/server.py
+++ b/obmc/mapper/server.py
@@ -469,6 +469,15 @@
 
         return match
 
+    def discovery_error_retry(self, owner, path, e):
+        sys.stderr.write(
+            '{} discovery failure on {} - retry\n'.format(owner, path))
+        find_dbus_interfaces(self.bus, owner, '/',
+                             self.discovery_callback,
+                             self.discovery_error,
+                             subtree_match=self.path_match,
+                             iface_match=self.interface_match)
+
     def discover(self, owners=[]):
         def get_owner(name):
             try:
@@ -490,7 +499,7 @@
             find_dbus_interfaces(
                 self.bus, owned_name, '/',
                 self.discovery_callback,
-                self.discovery_error,
+                self.discovery_error_retry,
                 subtree_match=self.path_match,
                 iface_match=self.interface_match)