Merge remote-tracking branch 'origin/geni-v3' into geni-v3
[sfa.git] / sfa / federica / fddriver.py
index 1e16d7f..cec702d 100644 (file)
@@ -2,7 +2,7 @@ from sfa.util.sfalogging import logger
 from sfa.util.faults import SfaFault
 
 # this is probably too big to swallow but for a starting point..
-from sfa.plc.pldriver import PlDriver
+from sfa.planetlab.pldriver import PlDriver
 
 from sfa.federica.fdshell import FdShell
 
@@ -23,8 +23,9 @@ federica_version_string="RSpecV2"
 
 class FdDriver (PlDriver):
 
-    def __init__ (self,config): 
-        PlDriver.__init__ (self, config)
+    def __init__ (self,api): 
+        PlDriver.__init__ (self, api)
+        config = api.config
         self.shell=FdShell(config)
 
     # the agreement with the federica driver is for them to expose results in a way
@@ -54,7 +55,11 @@ class FdDriver (PlDriver):
         return "federica"
 
     def list_slices (self, creds, options):
-        return self.response(self.shell.listSlices())
+        # the issue is that federica returns the list of slice's urn in a string format
+        # this is why this dirty hack is needed until federica fixes it. 
+        slices_str = self.shell.listSlices()['value'][1:-1]
+        slices_list = slices_str.split(", ")
+        return slices_list
 
     def sliver_status (self, slice_urn, slice_hrn):
         return "fddriver.sliver_status: undefined/todo for slice %s"%slice_hrn