no need for that
[plcapi.git] / PLC / SFA.py
index b1cdbc4..ce097f9 100644 (file)
@@ -69,7 +69,7 @@ class SFA:
         elif object.has_key('site_ids') and object['site_ids']:
             site_ids.extend(object['site_ids'])
         else:
-            raise Exception
+            return login_bases
 
         # get the login bases
         for site_id in site_ids:
@@ -81,11 +81,11 @@ class SFA:
         parent_hrn = authority + "." + login_base 
         if type in ['person', 'user']:
             name_parts = object['email'].split("@")
-            hrn = parent_hrn + "." + name_parts[:1]
+            hrn = parent_hrn + "." + name_parts[:1][0]
         
         elif type in ['slice']:
             name_parts = object['name'].split("_")
-            hrn = parent_hrn + "." + name_parts[-1:]
+            hrn = parent_hrn + "." + name_parts[-1:][0]
         
         elif type in ['node']:
             hrn = hostname_to_hrn(self.authority, login_base, object['hostname'])