Index: fedd/federation/emulab_access.py
===================================================================
--- fedd/federation/emulab_access.py	(revision 3159f5d49e0a14eec04e80cc7845f2b552e2068d)
+++ fedd/federation/emulab_access.py	(revision 1dcaff49c4df486ca723d11abd42d1a08a68c5a0)
@@ -1318,40 +1318,4 @@
 
     def StartSegment(self, req, fid):
-	def get_url(url, cf, destdir, fn=None):
-	    po = urlparse(url)
-	    if not fn:
-		fn = po.path.rpartition('/')[2]
-	    ok = False
-	    retries = 0
-	    while not ok and retries < 5:
-		try:
-		    conn = httplib.HTTPSConnection(po.hostname, port=po.port, 
-			    cert_file=cf, key_file=cf)
-		    conn.putrequest('GET', po.path)
-		    conn.endheaders()
-		    response = conn.getresponse()
-
-		    lf = open("%s/%s" % (destdir, fn), "w")
-		    buf = response.read(4096)
-		    while buf:
-			lf.write(buf)
-			buf = response.read(4096)
-		    lf.close()
-		    ok = True
-		except IOError, e:
-		    print e
-		    raise service_error(service_error.internal,
-			    "Error writing tempfile: %s" %e)
-		except httplib.HTTPException, e:
-		    print e
-		    raise service_error(service_error.internal, 
-			    "Error retrieving data: %s" % e)
-		except SSLError, e:
-		    print "SSL error %s" %e
-		    retries += 1
-
-	    if retries > 5:
-		raise service_error(service_error.internal,
-			"Repeated SSL failures")
 
 	configs = set(('hosts', 'ssh_pubkey', 'ssh_secretkey'))
@@ -1396,9 +1360,13 @@
 		for s in getattr(e, 'software', []):
 		    sw.add(s.location)
-	    if len(sw) > 0:
-		os.mkdir(softdir)
+	    os.mkdir(softdir)
 	    for s in sw:
 		self.log.debug("Retrieving %s" % s)
-		get_url(s, certfile, softdir)
+		try:
+		    get_url(s, certfile, softdir)
+		except:
+		    t, v, st = sys.exc_info()
+		    raise service_error(service_error.internal,
+			    "Error retrieving %s: %s" % (s, v))
 
 	    # Copy local federation and portal node software to the tempdir
@@ -1410,5 +1378,10 @@
 	    for a in attrs:
 		if a['attribute'] in configs:
-		    get_url(a['value'], certfile, tmpdir)
+		    try:
+			get_url(a['value'], certfile, tmpdir)
+		    except:
+			t, v, st = sys.exc_info()
+			raise service_error(service_error.internal,
+				"Error retrieving %s: %s" % (s, v))
 		if a['attribute'] == 'ssh_pubkey':
 		    pubkey_base = a['value'].rpartition('/')[2]
@@ -1447,4 +1420,8 @@
 				    "Cannot create temp file for " + 
 				    "userconfig certificates: %s e")
+			except:
+			    t, v, st = sys.exc_info()
+			    raise service_error(service_error.internal,
+				    "Error retrieving %s: %s" % (s, v))
 			finally:
 			    if tn: os.remove(tn)
Index: fedd/federation/experiment_control.py
===================================================================
--- fedd/federation/experiment_control.py	(revision 3159f5d49e0a14eec04e80cc7845f2b552e2068d)
+++ fedd/federation/experiment_control.py	(revision 1dcaff49c4df486ca723d11abd42d1a08a68c5a0)
@@ -936,6 +936,7 @@
         if r.has_key('Ns2SplitResponseBody'):
             r = r['Ns2SplitResponseBody']
-            if r.has_key('output'):
-                return r['output'].splitlines()
+	    ed = r.get('experimentdescription', None)
+            if ed.has_key('topdldescription'):
+                return topdl.Topology(**ed['topdldescription'])
             else:
                 raise service_error(service_error.protocol, 
@@ -2116,5 +2117,5 @@
                 self.log.debug("Calling remote splitter at %s" % \
                         self.splitter_url)
-                split_data = self.remote_splitter(self.splitter_url,
+                top = self.remote_splitter(self.splitter_url,
                         file_content, master)
             else:
@@ -2133,5 +2134,5 @@
                 split_data = tclparser.stdout
 
-	    top = topdl.topology_from_xml(file=split_data, top="experiment")
+		top = topdl.topology_from_xml(file=split_data, top="experiment")
 
 	    hosts, ip_allocator = self.allocate_ips_to_topo(top)
Index: fedd/federation/protogeni_access.py
===================================================================
--- fedd/federation/protogeni_access.py	(revision 3159f5d49e0a14eec04e80cc7845f2b552e2068d)
+++ fedd/federation/protogeni_access.py	(revision 1dcaff49c4df486ca723d11abd42d1a08a68c5a0)
@@ -253,16 +253,4 @@
                     (lineno, config))
         f.close()
-
-# need this ?
-    def get_users(self, obj):
-        """
-        Return a list of the IDs of the users in dict
-        """
-        if obj.has_key('user'):
-            return [ unpack_id(u['userID']) \
-                    for u in obj['user'] if u.has_key('userID') ]
-        else:
-            return None
-# need this ?
 
     def write_state(self):
@@ -899,41 +887,4 @@
 
     def StartSegment(self, req, fid):
-	def get_url(url, cf, destdir, fn=None):
-	    po = urlparse(url)
-	    if not fn:
-		fn = po.path.rpartition('/')[2]
-	    retries = 0
-	    ok = False
-	    while not ok and retries < 5:
-		try:
-		    conn = httplib.HTTPSConnection(po.hostname, port=po.port, 
-			    cert_file=cf, key_file=cf)
-		    conn.putrequest('GET', po.path)
-		    conn.endheaders()
-		    response = conn.getresponse()
-
-		    lf = open("%s/%s" % (destdir, fn), "w")
-		    buf = response.read(4096)
-		    while buf:
-			lf.write(buf)
-			buf = response.read(4096)
-		    lf.close()
-		    ok = True
-		except IOError, e:
-		    print e
-		    raise service_error(service_error.internal,
-			    "Error writing tempfile: %s" %e)
-		except httplib.HTTPException, e:
-		    print e
-		    raise service_error(service_error.internal, 
-			    "Error retrieving data: %s" % e)
-		except SSLError, e:
-		    print "SSL error %s" %e
-		    retries += 1
-
-	    if retries > 5:
-		raise service_error(service_error.internal,
-			"Repeated SSL failures")
-
 
 	configs = set(('hosts', 'ssh_pubkey', 'ssh_secretkey'))
@@ -979,9 +930,13 @@
 		for s in getattr(e, 'software', []):
 		    sw.add(s.location)
-	    if len(sw) > 0:
-		os.mkdir(softdir)
+	    os.mkdir(softdir)
 	    for s in sw:
 		self.log.debug("Retrieving %s" % s)
-		get_url(s, certfile, softdir)
+		try:
+		    get_url(s, certfile, softdir)
+		except:
+		    t, v, st = sys.exc_info()
+		    raise service_error(service_error.internal,
+			    "Error retrieving %s: %s" % (s, v))
 
 	    # Copy local portal node software to the tempdir
@@ -1000,5 +955,11 @@
 	    for a in attrs:
 		if a['attribute'] in configs:
-		    get_url(a['value'], certfile, tmpdir)
+		    try:
+			self.log.debug("Retrieving %s" % a['value'])
+			get_url(a['value'], certfile, tmpdir)
+		    except:
+			t, v, st = sys.exc_info()
+			raise service_error(service_error.internal,
+				"Error retrieving %s: %s" % (s, v))
 		if a['attribute'] == 'ssh_pubkey':
 		    pubkey_base = a['value'].rpartition('/')[2]
@@ -1037,4 +998,8 @@
 				    "Cannot create temp file for " + 
 				    "userconfig certificates: %s e")
+			except:
+			    t, v, st = sys.exc_info()
+			    raise service_error(service_error.internal,
+				    "Error retrieving %s: %s" % (u, v))
 			finally:
 			    if tn: os.remove(tn)
@@ -1043,6 +1008,4 @@
 				"No certificate for retreiving userconfig")
 		    break
-
-
 
 	    self.state_lock.acquire()
Index: fedd/federation/remote_service.py
===================================================================
--- fedd/federation/remote_service.py	(revision 3159f5d49e0a14eec04e80cc7845f2b552e2068d)
+++ fedd/federation/remote_service.py	(revision 1dcaff49c4df486ca723d11abd42d1a08a68c5a0)
@@ -9,4 +9,5 @@
 from M2Crypto.m2xmlrpclib import SSL_Transport
 from M2Crypto.SSL import SSLError
+from M2Crypto.BIO import BIOError
 from ZSI import ParseException, FaultException, SoapWriter
 
@@ -364,4 +365,7 @@
 		raise service_error(service_error.connect, 
 			"Cannot connect to %s: %s" % (url, e[1]))
+	    except BIOError, e:
+		print "BIO error contacting %s: %s" % (url, e.message)
+		retries += 1
 	    except SSLError, e:
 		print "SSL error contacting %s: %s" % (url, e.message)
@@ -439,4 +443,7 @@
 		raise service_error(service_error.connect, 
 			"Cannot connect to %s: %s" % (url, e[1]))
+	    except BIOError, e:
+		print "BIO error contacting %s: %s" % (url, e.message)
+		retries += 1
 	    except SSLError, e:
 		print "SSL error contacting %s: %s" % (url, e.message)
Index: fedd/federation/util.py
===================================================================
--- fedd/federation/util.py	(revision 3159f5d49e0a14eec04e80cc7845f2b552e2068d)
+++ fedd/federation/util.py	(revision 1dcaff49c4df486ca723d11abd42d1a08a68c5a0)
@@ -5,6 +5,11 @@
 import logging
 
+import httplib
+
 from M2Crypto import SSL
+from M2Crypto.SSL import SSLError
 from fedid import fedid
+from service_error import service_error
+from urlparse import urlparse
 
 
@@ -169,2 +174,41 @@
     d.close()
 
+def get_url(url, cf, destdir, fn=None, max_retries=5):
+    """
+    Get data from a federated data store.  This presents the client cert/fedid
+    to the http server.  We retry up to max_retries times.
+    """
+    po = urlparse(url)
+    if not fn:
+	fn = po.path.rpartition('/')[2]
+    retries = 0
+    ok = False
+    failed_exception = None
+    while not ok and retries < 5:
+	try:
+	    conn = httplib.HTTPSConnection(po.hostname, port=po.port, 
+		    cert_file=cf, key_file=cf)
+	    conn.putrequest('GET', po.path)
+	    conn.endheaders()
+	    response = conn.getresponse()
+
+	    lf = open("%s/%s" % (destdir, fn), "w")
+	    buf = response.read(4096)
+	    while buf:
+		lf.write(buf)
+		buf = response.read(4096)
+	    lf.close()
+	    ok = True
+	except IOError, e:
+	    failed_excpetion = e
+	    retries += 1
+	except httplib.HTTPException, e:
+	    failed_exception = e
+	    retries += 1
+	except SSLError, e:
+	    failed_exception = e
+	    retries += 1
+
+    if retries > 5 and failed_exception:
+	raise failed_excpetion
+
