From 98b9dae9cfd24ff00b75ea2073570640b699f1c6 Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Fri, 22 May 2009 04:43:11 +0000 Subject: [PATCH] More complete handling of 4.2 calls mapped to 4.3 calls. --- PLC/Methods/AddNodeNetworkSettingType.py | 2 +- PLC/Methods/AddSliceAttribute.py | 13 +++++++++++++ PLC/Methods/AddSliceAttributeType.py | 2 +- PLC/Methods/DeleteNodeNetworkSettingType.py | 2 +- PLC/Methods/DeleteSliceAttribute.py | 13 +++++++++++++ PLC/Methods/DeleteSliceAttributeType.py | 2 +- PLC/Methods/GetNodeNetworkSettingTypes.py | 2 +- PLC/Methods/GetSliceAttributeTypes.py | 2 +- PLC/Methods/GetSliceAttributes.py | 13 +++++++++++++ PLC/Methods/UpdateNodeNetworkSettingType.py | 2 +- PLC/Methods/UpdateSliceAttribute.py | 13 +++++++++++++ PLC/Methods/UpdateSliceAttributeType.py | 2 +- PLC/Methods/__init__.py | 4 ++++ PLC/__init__.py | 4 +++- PLC/v42LegacyNodeNetworkSettingTypes.py | 10 ++++++++++ PLC/v42LegacySliceAttributeTypes.py | 12 ++++++++++++ ...42LegacyTypes.py => v42LegacySliceAttributes.py} | 5 ++++- 17 files changed, 93 insertions(+), 10 deletions(-) create mode 100644 PLC/Methods/AddSliceAttribute.py create mode 100644 PLC/Methods/DeleteSliceAttribute.py create mode 100644 PLC/Methods/GetSliceAttributes.py create mode 100644 PLC/Methods/UpdateSliceAttribute.py create mode 100644 PLC/v42LegacyNodeNetworkSettingTypes.py create mode 100644 PLC/v42LegacySliceAttributeTypes.py rename PLC/{v42LegacyTypes.py => v42LegacySliceAttributes.py} (70%) diff --git a/PLC/Methods/AddNodeNetworkSettingType.py b/PLC/Methods/AddNodeNetworkSettingType.py index a230606..9b3585f 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 0000000..150be9c --- /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 8a4c50f..d2c830f 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 2947830..f06c5a1 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 0000000..733fe78 --- /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 1ea63ed..818f178 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 9e432ee..9d6026d 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 1c05e44..278cf70 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 0000000..be10198 --- /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 611f131..503fba1 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 0000000..1fe3e93 --- /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 a4a0870..3b63cbd 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 939c4ee..c7ea6dc 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 7102749..6096fb2 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 0000000..ede330b --- /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 0000000..8978362 --- /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 e6fd697..c887aee 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) -- 2.45.2