blind 2to3
[plcapi.git] / PLC / Methods / UnBindObjectFromPeer.py
index 1e5c4f5..b90475b 100644 (file)
@@ -1,6 +1,3 @@
-# $Id: UnBindObjectFromPeer.py 14587 2009-07-19 13:18:50Z thierry $
-# $URL: svn+ssh://svn.planet-lab.org/svn/PLCAPI/trunk/PLC/Methods/BindObjectToPeer.py $
-
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
 from PLC.Filter import Filter
@@ -12,14 +9,14 @@ from PLC.Slices import Slices
 from PLC.Keys import Keys
 from PLC.Peers import Peers
 from PLC.Faults import *
+
 class UnBindObjectFromPeer(Method):
     """
     This method is a hopefully temporary hack to let the sfa correctly
     detach the objects it creates from a remote peer object. This is
     needed so that the sfa federation link can work in parallel with
     RefreshPeer, as RefreshPeer depends on remote objects being
-    correctly marked. 
+    correctly marked.
 
     UnBindObjectFromPeer is allowed to admins only.
     """
@@ -46,8 +43,8 @@ class UnBindObjectFromPeer(Method):
         # invoke e.g. Nodes ({'node_id':node_id})
         objs=class_obj(self.api,{id_name:object_id})
         if len(objs) != 1:
-            raise PLCInvalidArgument,"Cannot locate object, type=%s id=%d"%\
-                (type,object_id)
+            raise PLCInvalidArgument("Cannot locate object, type=%s id=%d"%\
+                (type,object_id))
         return objs[0]
 
 
@@ -55,11 +52,11 @@ class UnBindObjectFromPeer(Method):
 
         object_type = object_type.lower()
         if object_type not in self.known_types:
-            raise PLCInvalidArgument, 'Unrecognized object type %s'%object_type
+            raise PLCInvalidArgument('Unrecognized object type %s'%object_type)
 
         peers=Peers(self.api,{'shortname':shortname.upper()})
         if len(peers) !=1:
-            raise PLCInvalidArgument, 'No such peer with shortname %s'%shortname
+            raise PLCInvalidArgument('No such peer with shortname %s'%shortname)
 
         peer=peers[0]
         object = self.locate_object (object_type, object_id)