Index: fedd/federation/protogeni_access.py
===================================================================
--- fedd/federation/protogeni_access.py	(revision 208797c18a36ab60d41373d4305eb6da39360f64)
+++ fedd/federation/protogeni_access.py	(revision c709b7e683e1ceef225d00b09bd906d7b54d630a)
@@ -344,5 +344,6 @@
 			self.d[self.current_key] = {
 				'hostname': attrs.get('hostname', None),
-				'interfaces': { }
+				'interfaces': { },
+				'mac': { }
 				}
 		elif name == 'interface' and self.current_key:
@@ -350,4 +351,11 @@
 			    [attrs.get('virtual_id','')] = \
 			    attrs.get('component_id', None)
+		elif name == 'interface_ref':
+		    # Collect mac address information from an interface_ref.
+		    # These appear after the node info has been parsed.
+		    nid = attrs.get('virtual_node_id', None)
+		    ifid = attrs.get('virtual_interface_id', None)
+		    mac = attrs.get('MAC', None)
+		    self.d[nid]['mac'][ifid] = mac
 	    #  When a node is finished, clear current_key
 	    def end_element(self, name):
@@ -652,4 +660,5 @@
 
 	ifconfig = "/sbin/ifconfig"
+	findif = '/usr/local/etc/emulab/findif'
 	stage_file = stage_file_type(user, self.staging_host, stagingdir)
 	pname = node.get('hostname', None)
@@ -666,10 +675,15 @@
 		    if not i.get_attribute('portal')]:
 		pinf = node['interfaces'].get(i.name, None)
+		pmac = node['mac'].get(i.name, None)
 		addr = i.get_attribute('ip4_address') 
 		netmask = i.get_attribute('ip4_netmask') or '255.255.255.0'
-		if pinf and addr:
+		# The interface names in manifests are not to be trusted, so we
+		# find the interface to configure using the local node's script
+		# to match mac address to interface name.
+		if pinf and addr and pmac:
+		    print >>script, '# %s' % pinf
 		    print >>script, \
-			    "%s %s %s netmask %s"  % \
-			    (ifconfig, pinf, addr, netmask)
+			    "%s `%s %s` %s netmask %s"  % \
+			    (ifconfig, findif, pmac, addr, netmask)
 		else:
 		    self.log.error("Missing interface or address for %s" \
@@ -930,5 +944,5 @@
 		    "ProtoGENI: %s %s" % (e.code, e))
 
-	return (slice_urn, slice_cred, manifest)
+	return (slice_urn, slice_cred, manifest, rspec)
 
     def wait_for_slice(self, segment_commands, slice_cred, slice_urn, ctxt, 
@@ -997,10 +1011,10 @@
 		certfile, certpw)
 
-	if not ctxt: return False
+	if not ctxt: return False, {}
 
 	self.set_up_staging_filespace(segment_commands, user, host, stagingdir)
 	slicename = self.get_free_slicename(segment_commands, user, gcred, ctxt)
 	self.log.info("Creating %s" % slicename)
-	slice_urn, slice_cred, manifest = self.allocate_slice(
+	slice_urn, slice_cred, manifest, rpsec = self.allocate_slice(
 		segment_commands, slicename, rspec, gcred, ctxt)
 
@@ -1023,5 +1037,5 @@
 				user, host, "%s/%s" % (stagingdir, f)):
 			    self.log.error("Scp failed")
-			    return False
+			    return False, {}
 
 
@@ -1032,9 +1046,9 @@
 	    self.log.error('Sliver failed to start on ProtoGENI')
 	    self.delete_slice(segment_commands, slice_cred, slice_urn, ctxt)
-	    return False
+	    return False, {}
 	elif status == 'timeout':
 	    self.log.error('Sliver failed to start on ProtoGENI (timeout)')
 	    self.delete_slice(segment_commands, slice_cred, slice_urn, ctxt)
-	    return False
+	    return False, {}
 	else:
 	    # All good: save ProtoGENI info in shared state
@@ -1044,4 +1058,5 @@
 	    self.allocation[aid]['slice_credential'] = slice_cred
 	    self.allocation[aid]['manifest'] = manifest
+	    self.allocation[aid]['rspec'] = rspec
 	    self.allocation[aid]['certfile'] = certfile
 	    self.allocation[aid]['certpw'] = certpw
@@ -1396,17 +1411,5 @@
 	    param = {
 		    'credential': cred,
-		    'hrn': name,
-		    'type': 'Slice',
-		    }
-	    slice = segment_commands.slice_authority_call('Resolve', 
-		    param, ctxt)
-	    uuid = slice.get('uuid', None)
-	    if uuid == None:
-		sys.exit('No uuid for %s' % slicename)
-
-	    print 'Calling GetCredential (uuid)'
-	    param = {
-		    'credential': cred,
-		    'uuid': uuid,
+		    'urn': slice_urn,
 		    'type': 'Slice',
 		    }
@@ -1418,5 +1421,4 @@
 	    return None
 	try:
-	    print 'Calling RenewSlice (CM)'
 	    param = {
 		    'credentials': [new_scred,],
