convert the hrn to a planetlab slice name
authorTony Mack <tmack@cs.princeton.edu>
Mon, 9 Nov 2009 01:46:20 +0000 (01:46 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 9 Nov 2009 01:46:20 +0000 (01:46 +0000)
sfacomponent/methods/delete_slice.py
sfacomponent/methods/reset_slice.py
sfacomponent/methods/start_slice.py
sfacomponent/methods/stop_slice.py

index ce7be45..95337e0 100644 (file)
@@ -34,6 +34,7 @@ class delete_slice(Method):
         client_gid_str = client_gid.save_to_string(save_parents=True)
         self.api.auth.authenticateGid(client_gid_str, [cred, hrn], request_hash)
         self.api.auth.check(cred, 'deleteslice')
-        self.api.nodemanager.Destroy(hrn)
+        slicename = hrn_to_pl_slicename(hrn)
+        self.api.nodemanager.Destroy(slicename)
         
         return 1 
index bc4431c..4d1693d 100644 (file)
@@ -34,10 +34,10 @@ class reset_slice(Method):
         client_gid_str = client_gid.save_to_string(save_parents=True)
         self.api.auth.authenticateGid(client_gid_str, [cred, hrn], request_hash)
         self.api.auth.check(cred, 'resetslice')
+        slicename = hrn_to_pl_slicename(hrn)
+        if not self.api.sliver_exists(slicename):
+            raise SliverDoesNotExist(slicename)
 
-        if not self.api.sliver_exists(hrn):
-            raise SliverDoesNotExist(hrn)
-
-        self.api.nodemanager.ReCreate(hrn)
+        self.api.nodemanager.ReCreate(slicename)
         
         return 1 
index c8997f8..6dba65c 100644 (file)
@@ -34,6 +34,7 @@ class start_slice(Method):
         client_gid_str = client_gid.save_to_string(save_parents=True)
         self.api.auth.authenticateGid(client_gid_str, [cred, hrn], request_hash)
         self.api.auth.check(cred, 'startslice')
-        self.api.nodemanager.Start(hrn)
+        slicename = hrn_to_pl_slicename(hrn)
+        self.api.nodemanager.Start(slicename)
         
         return 1 
index a5be98a..e4149b3 100644 (file)
@@ -34,6 +34,7 @@ class stop_slice(Method):
         client_gid_str = client_gid.save_to_string(save_parents=True)
         self.api.auth.authenticateGid(client_gid_str, [cred, hrn], request_hash)
         self.api.auth.check(cred, 'stopslice')
-        self.api.nodemanager.Stop(hrn)
+        slicename = hrn_to_pl_slicename(hrn) 
+        self.api.nodemanager.Stop(slicename)
         
         return 1