From: Marc Fiuczynski <mef@cs.princeton.edu>
Date: Fri, 22 May 2009 04:43:11 +0000 (+0000)
Subject: More complete handling of 4.2 calls mapped to 4.3 calls.
X-Git-Tag: PLCAPI-4.3-15~7
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=98b9dae9cfd24ff00b75ea2073570640b699f1c6;p=plcapi.git

More complete handling of 4.2 calls mapped to 4.3 calls.
---

diff --git a/PLC/Methods/AddNodeNetworkSettingType.py b/PLC/Methods/AddNodeNetworkSettingType.py
index a230606f..9b3585fa 100644
--- a/PLC/Methods/AddNodeNetworkSettingType.py
+++ b/PLC/Methods/AddNodeNetworkSettingType.py
@@ -1,6 +1,6 @@
 
 from PLC.v42Legacy import patch
-from PLC.v42LegacyTypes import v42rename, v43rename
+from PLC.v42LegacyNodeNetworkSettingTypes import v42rename, v43rename
 from PLC.Methods.AddTagType import AddTagType
 class AddNodeNetworkSettingType(AddTagType):
     """ Legacy version of AddTagType. """
diff --git a/PLC/Methods/AddSliceAttribute.py b/PLC/Methods/AddSliceAttribute.py
new file mode 100644
index 00000000..150be9cc
--- /dev/null
+++ b/PLC/Methods/AddSliceAttribute.py
@@ -0,0 +1,13 @@
+
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributes import v42rename, v43rename
+from PLC.Methods.AddSliceTag import AddSliceTag
+class AddSliceAttribute(AddSliceTag):
+    """ Legacy version of AddSliceTag. """
+    skip_typecheck = True
+    status = "deprecated"
+    def call(self, auth, *args, **kwds):
+        newargs=[patch(x,v42rename) for x in args]
+        newkwds=dict ( [ (k,patch(v,v42rename)) for (k,v) in kwds.iteritems() ] )
+        results = AddSliceTag.call(self,auth,*newargs,**newkwds)
+        return patch(results,v43rename)
diff --git a/PLC/Methods/AddSliceAttributeType.py b/PLC/Methods/AddSliceAttributeType.py
index 8a4c50f7..d2c830ff 100644
--- a/PLC/Methods/AddSliceAttributeType.py
+++ b/PLC/Methods/AddSliceAttributeType.py
@@ -1,6 +1,6 @@
 
 from PLC.v42Legacy import patch
-from PLC.v42LegacyTypes import v42rename, v43rename
+from PLC.v42LegacyAttributeTypes import v42rename, v43rename
 from PLC.Methods.AddTagType import AddTagType
 class AddSliceAttributeType(AddTagType):
     """ Legacy version of AddTagType. """
diff --git a/PLC/Methods/DeleteNodeNetworkSettingType.py b/PLC/Methods/DeleteNodeNetworkSettingType.py
index 29478303..f06c5a15 100644
--- a/PLC/Methods/DeleteNodeNetworkSettingType.py
+++ b/PLC/Methods/DeleteNodeNetworkSettingType.py
@@ -1,6 +1,6 @@
 
 from PLC.v42Legacy import patch
-from PLC.v42LegacyTypes import v42rename, v43rename
+from PLC.v42LegacyNodeNetworkSettingTypes import v42rename, v43rename
 from PLC.Methods.DeleteTagType import DeleteTagType
 class DeleteNodeNetworkSettingType(DeleteTagType):
     """ Legacy version of DeleteTagType. """
diff --git a/PLC/Methods/DeleteSliceAttribute.py b/PLC/Methods/DeleteSliceAttribute.py
new file mode 100644
index 00000000..733fe78f
--- /dev/null
+++ b/PLC/Methods/DeleteSliceAttribute.py
@@ -0,0 +1,13 @@
+
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributes import v42rename, v43rename
+from PLC.Methods.DeleteSliceTag import DeleteSliceTag
+class DeleteSliceAttribute(DeleteSliceTag):
+    """ Legacy version of DeleteSliceTag. """
+    skip_typecheck = True
+    status = "deprecated"
+    def call(self, auth, *args, **kwds):
+        newargs=[patch(x,v42rename) for x in args]
+        newkwds=dict ( [ (k,patch(v,v42rename)) for (k,v) in kwds.iteritems() ] )
+        results = DeleteSliceTag.call(self,auth,*newargs,**newkwds)
+        return patch(results,v43rename)
diff --git a/PLC/Methods/DeleteSliceAttributeType.py b/PLC/Methods/DeleteSliceAttributeType.py
index 1ea63ed8..818f1788 100644
--- a/PLC/Methods/DeleteSliceAttributeType.py
+++ b/PLC/Methods/DeleteSliceAttributeType.py
@@ -1,6 +1,6 @@
 
 from PLC.v42Legacy import patch
-from PLC.v42LegacyTypes import v42rename, v43rename
+from PLC.v42LegacyAttributeTypes import v42rename, v43rename
 from PLC.Methods.DeleteTagType import DeleteTagType
 class DeleteSliceAttributeType(DeleteTagType):
     """ Legacy version of DeleteTagType. """
diff --git a/PLC/Methods/GetNodeNetworkSettingTypes.py b/PLC/Methods/GetNodeNetworkSettingTypes.py
index 9e432eee..9d6026d9 100644
--- a/PLC/Methods/GetNodeNetworkSettingTypes.py
+++ b/PLC/Methods/GetNodeNetworkSettingTypes.py
@@ -1,6 +1,6 @@
 
 from PLC.v42Legacy import patch
-from PLC.v42LegacyTypes import v42rename, v43rename
+from PLC.v42LegacyNodeNetworkSettingTypes import v42rename, v43rename
 from PLC.Methods.GetTagTypes import GetTagTypes
 class GetNodeNetworkSettingTypes(GetTagTypes):
     """ Legacy version of GetTagTypes. """
diff --git a/PLC/Methods/GetSliceAttributeTypes.py b/PLC/Methods/GetSliceAttributeTypes.py
index 1c05e442..278cf702 100644
--- a/PLC/Methods/GetSliceAttributeTypes.py
+++ b/PLC/Methods/GetSliceAttributeTypes.py
@@ -1,6 +1,6 @@
 
 from PLC.v42Legacy import patch
-from PLC.v42LegacyTypes import v42rename, v43rename
+from PLC.v42LegacyAttributeTypes import v42rename, v43rename
 from PLC.Methods.GetTagTypes import GetTagTypes
 class GetSliceAttributeTypes(GetTagTypes):
     """ Legacy version of GetTagTypes. """
diff --git a/PLC/Methods/GetSliceAttributes.py b/PLC/Methods/GetSliceAttributes.py
new file mode 100644
index 00000000..be101989
--- /dev/null
+++ b/PLC/Methods/GetSliceAttributes.py
@@ -0,0 +1,13 @@
+
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributes import v42rename, v43rename
+from PLC.Methods.GetSliceTags import GetSliceTags
+class GetSliceAttributes(GetSliceTags):
+    """ Legacy version of GetSliceTags. """
+    skip_typecheck = True
+    status = "deprecated"
+    def call(self, auth, *args, **kwds):
+        newargs=[patch(x,v42rename) for x in args]
+        newkwds=dict ( [ (k,patch(v,v42rename)) for (k,v) in kwds.iteritems() ] )
+        results = GetSliceTags.call(self,auth,*newargs,**newkwds)
+        return patch(results,v43rename)
diff --git a/PLC/Methods/UpdateNodeNetworkSettingType.py b/PLC/Methods/UpdateNodeNetworkSettingType.py
index 611f1318..503fba1b 100644
--- a/PLC/Methods/UpdateNodeNetworkSettingType.py
+++ b/PLC/Methods/UpdateNodeNetworkSettingType.py
@@ -1,6 +1,6 @@
 
 from PLC.v42Legacy import patch
-from PLC.v42LegacyTypes import v42rename, v43rename
+from PLC.v42LegacyNodeNetworkSettingTypes import v42rename, v43rename
 from PLC.Methods.UpdateTagType import UpdateTagType
 class UpdateNodeNetworkSettingType(UpdateTagType):
     """ Legacy version of UpdateTagType. """
diff --git a/PLC/Methods/UpdateSliceAttribute.py b/PLC/Methods/UpdateSliceAttribute.py
new file mode 100644
index 00000000..1fe3e932
--- /dev/null
+++ b/PLC/Methods/UpdateSliceAttribute.py
@@ -0,0 +1,13 @@
+
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributes import v42rename, v43rename
+from PLC.Methods.UpdateSliceTag import UpdateSliceTag
+class UpdateSliceAttribute(UpdateSliceTag):
+    """ Legacy version of UpdateSliceTag. """
+    skip_typecheck = True
+    status = "deprecated"
+    def call(self, auth, *args, **kwds):
+        newargs=[patch(x,v42rename) for x in args]
+        newkwds=dict ( [ (k,patch(v,v42rename)) for (k,v) in kwds.iteritems() ] )
+        results = UpdateSliceTag.call(self,auth,*newargs,**newkwds)
+        return patch(results,v43rename)
diff --git a/PLC/Methods/UpdateSliceAttributeType.py b/PLC/Methods/UpdateSliceAttributeType.py
index a4a0870f..3b63cbd6 100644
--- a/PLC/Methods/UpdateSliceAttributeType.py
+++ b/PLC/Methods/UpdateSliceAttributeType.py
@@ -1,6 +1,6 @@
 
 from PLC.v42Legacy import patch
-from PLC.v42LegacyTypes import v42rename, v43rename
+from PLC.v42LegacyAttributeTypes import v42rename, v43rename
 from PLC.Methods.UpdateTagType import UpdateTagType
 class UpdateSliceAttributeType(UpdateTagType):
     """ Legacy version of UpdateTagType. """
diff --git a/PLC/Methods/__init__.py b/PLC/Methods/__init__.py
index 939c4eed..c7ea6dc0 100644
--- a/PLC/Methods/__init__.py
+++ b/PLC/Methods/__init__.py
@@ -36,6 +36,7 @@ AddRoleToPerson
 AddSession
 AddSiteAddress
 AddSite
+AddSliceAttribute
 AddSliceAttributeType
 AddSliceInstantiation
 AddSlice
@@ -86,6 +87,7 @@ DeleteRoleFromPerson
 DeleteRole
 DeleteSession
 DeleteSite
+DeleteSliceAttribute
 DeleteSliceAttributeType
 DeleteSliceFromNodes
 DeleteSliceFromNodesWhitelist
@@ -131,6 +133,7 @@ GetRoles
 GetSession
 GetSessions
 GetSites
+GetSliceAttributes
 GetSliceAttributeTypes
 GetSliceInstantiations
 GetSliceKeys
@@ -191,6 +194,7 @@ UpdatePCUType
 UpdatePeer
 UpdatePerson
 UpdateSite
+UpdateSliceAttribute
 UpdateSliceAttributeType
 UpdateSlice
 UpdateSliceTag
diff --git a/PLC/__init__.py b/PLC/__init__.py
index 7102749d..6096fb26 100644
--- a/PLC/__init__.py
+++ b/PLC/__init__.py
@@ -48,7 +48,9 @@ SliceTags
 Table
 TagTypes
 v42LegacyNodeNetworkSettings
+v42LegacyNodeNetworkSettingTypes
 v42LegacyNodeNetworks
 v42Legacy
-v42LegacyTypes
+v42LegacySliceAttributes
+v42LegacySliceAttributeTypes
 """.split()
diff --git a/PLC/v42LegacyNodeNetworkSettingTypes.py b/PLC/v42LegacyNodeNetworkSettingTypes.py
new file mode 100644
index 00000000..ede330bf
--- /dev/null
+++ b/PLC/v42LegacyNodeNetworkSettingTypes.py
@@ -0,0 +1,10 @@
+# $Id: $
+
+# mapping of argument/return names for *NodeNetworkSettingType*
+v42_to_v43_argmap = { "name":"tagname",
+                      "nodenetwork_setting_type_id": "tag_type_id",
+                      }
+v43_to_v42_argmap = dict([ (v,k) for k,v in v42_to_v43_argmap.iteritems()])
+
+def v42rename (x): return v42_to_v43_argmap.get(x,x)
+def v43rename (x): return v43_to_v42_argmap.get(x,x)
diff --git a/PLC/v42LegacySliceAttributeTypes.py b/PLC/v42LegacySliceAttributeTypes.py
new file mode 100644
index 00000000..8978362d
--- /dev/null
+++ b/PLC/v42LegacySliceAttributeTypes.py
@@ -0,0 +1,12 @@
+# $Id: $
+
+# mapping of argument/return names for *SliceAttributeType* calls
+
+v42_to_v43_argmap = { "name":"tagname",
+                      "slice_attribute_id":"slice_tag_id",
+                      "attribute_type_id":"tag_type_id",
+                      }
+v43_to_v42_argmap = dict([ (v,k) for k,v in v42_to_v43_argmap.iteritems()])
+
+def v42rename (x): return v42_to_v43_argmap.get(x,x)
+def v43rename (x): return v43_to_v42_argmap.get(x,x)
diff --git a/PLC/v42LegacyTypes.py b/PLC/v42LegacySliceAttributes.py
similarity index 70%
rename from PLC/v42LegacyTypes.py
rename to PLC/v42LegacySliceAttributes.py
index e6fd697f..c887aee8 100644
--- a/PLC/v42LegacyTypes.py
+++ b/PLC/v42LegacySliceAttributes.py
@@ -1,7 +1,10 @@
 # $Id: $
 
 # mapping of argument/return names for *{SliceAttribute,NetworkSetting}Type* and *TagType* calls
-v42_to_v43_argmap = { "name":"tagname" }
+
+v42_to_v43_argmap = { "name":"tagname",
+                      "slice_attribute_id":"slice_tag_id",
+                      }
 v43_to_v42_argmap = dict([ (v,k) for k,v in v42_to_v43_argmap.iteritems()])
 
 def v42rename (x): return v42_to_v43_argmap.get(x,x)