X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2F__init__.py;h=000edba8aa9fb6ff8737e0d63db4004d8c913b5a;hb=be1560a0ece794e0f047e6e3c18d4b78ec746b15;hp=86731b5f11a8318a6001899dae66db85af09709f;hpb=d910a6190fec258ddbf0e26d01539839ac3fdc76;p=plcapi.git diff --git a/PLC/Methods/__init__.py b/PLC/Methods/__init__.py index 86731b5..000edba 100644 --- a/PLC/Methods/__init__.py +++ b/PLC/Methods/__init__.py @@ -1,167 +1,31 @@ -methods = """ -AddAddressType -AddAddressTypeToAddress -AddBootState -AddConfFile -AddConfFileToNode -AddConfFileToNodeGroup -AddInitScript -AddInterface -AddInterfaceSetting -AddInterfaceSettingType -AddKeyType -AddMessage -AddNetworkMethod -AddNetworkType -AddNode -AddNodeGroup -AddNodeToPCU -AddPCU -AddPCUProtocolType -AddPCUType -AddPeer -AddPerson -AddPersonKey -AddPersonToSite -AddPersonToSlice -AddRole -AddRoleToPerson -AddSession -AddSite -AddSiteAddress -AddSlice -AddSliceAttribute -AddSliceAttributeType -AddSliceInstantiation -AddSliceToNodes -AddSliceToNodesWhitelist -AuthCheck -BlacklistKey -BootCheckAuthentication -BootGetNodeDetails -BootNotifyOwners -BootUpdateNode -DeleteAddress -DeleteAddressType -DeleteAddressTypeFromAddress -DeleteBootState -DeleteConfFile -DeleteConfFileFromNode -DeleteConfFileFromNodeGroup -DeleteInitScript -DeleteInterface -DeleteInterfaceSetting -DeleteInterfaceSettingType -DeleteKey -DeleteKeyType -DeleteMessage -DeleteNetworkMethod -DeleteNetworkType -DeleteNode -DeleteNodeFromPCU -DeleteNodeGroup -DeletePCU -DeletePCUProtocolType -DeletePCUType -DeletePeer -DeletePerson -DeletePersonFromSite -DeletePersonFromSlice -DeleteRole -DeleteRoleFromPerson -DeleteSession -DeleteSite -DeleteSlice -DeleteSliceAttribute -DeleteSliceAttributeType -DeleteSliceFromNodes -DeleteSliceFromNodesWhitelist -DeleteSliceInstantiation -GenerateNodeConfFile -GetAddressTypes -GetAddresses -GetBootMedium -GetBootStates -GetConfFiles -GetEventObjects -GetEvents -GetInitScripts -GetInterfaceSettingTypes -GetInterfaceSettings -GetInterfaces -GetKeyTypes -GetKeys -GetMessages -GetNetworkMethods -GetNetworkTypes -GetNodeGroups -GetNodes -GetPCUProtocolTypes -GetPCUTypes -GetPCUs -GetPeerData -GetPeerName -GetPeers -GetPersons -GetPlcRelease -GetRoles -GetSession -GetSessions -GetSites -GetSliceAttributeTypes -GetSliceAttributes -GetSliceInstantiations -GetSliceKeys -GetSliceTicket -GetSlices -GetSlicesMD5 -GetSlivers -GetWhitelist -NotifyPersons -NotifySupport -RebootNode -RefreshPeer -ResetPassword -SetPersonPrimarySite -SliceCreate -SliceDelete -SliceExtendedInfo -SliceGetTicket -SliceInfo -SliceListNames -SliceListUserSlices -SliceNodesAdd -SliceNodesDel -SliceNodesList -SliceRenew -SliceTicketGet -SliceUpdate -SliceUserAdd -SliceUserDel -SliceUsersList -UpdateAddress -UpdateAddressType -UpdateConfFile -UpdateInitScript -UpdateInterface -UpdateInterfaceSetting -UpdateInterfaceSettingType -UpdateKey -UpdateMessage -UpdateNode -UpdateNodeGroup -UpdatePCU -UpdatePCUProtocolType -UpdatePCUType -UpdatePeer -UpdatePerson -UpdateSite -UpdateSlice -UpdateSliceAttribute -UpdateSliceAttributeType -VerifyPerson -system.listMethods -system.methodHelp -system.methodSignature -system.multicall -""".split() +#!/usr/bin/python -tt + +from __future__ import print_function + +import os +import glob + +native_methods = [] +toppath = os.path.dirname(__file__) + +# do not blindly scan this directory, as when using devel tools +# like `make sync` we can easily end up with more files that needed +# which breaks in production + +contents = [ + ('.', '[A-Z][a-zA-Z]*.py'), + ('system', '[a-zA-Z]*.py'), +] + +for dir, pattern in contents: + prefix = len(dir) + 1 + matches = glob.glob("{}/{}".format(dir, pattern)) + for match in matches: + filename = match[prefix:][:-3] + python_name = filename if dir == '.' \ + else "{}.{}".format(dir, filename) + native_methods.append(python_name) + +if __name__ == '__main__': + native_methods.sort() + print(native_methods)