X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fomf%2Fomf_resource.py;h=30482f1a96106e223fa2d51046d3c92a3fc8475c;hb=23d041fe2f0d9badf6d637009e2d42a4794325c1;hp=ddd4ad7e9bb74a1047f35f1f506f028dc9baf387;hpb=38cae419a35e2f1847dcb279a3e25597e79c80ee;p=nepi.git diff --git a/src/nepi/resources/omf/omf_resource.py b/src/nepi/resources/omf/omf_resource.py index ddd4ad7e..30482f1a 100644 --- a/src/nepi/resources/omf/omf_resource.py +++ b/src/nepi/resources/omf/omf_resource.py @@ -19,44 +19,57 @@ # Lucia Guevgeozian from nepi.execution.attribute import Attribute, Flags, Types -from nepi.execution.resource import ResourceManager, clsinit, ResourceState, \ - reschedule_delay +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState + class ResourceGateway: """ Dictionary used to set OMF gateway depending on Testbed information. """ + #XXX: A.Q. COMMENT: This looks a bit hardcoded + # SHOULDN'T THIS BE IN A SEPARATED FILE RATHER THAN IN THE + # BASE CLASS FOR ALL OMF RESOURCES? TestbedtoGateway = dict({ "wilabt" : "ops.wilab2.ilabt.iminds.be", "nitos" : "nitlab.inf.uth.gr", "nicta" : "??.??.??", + }) + AMtoGateway = dict({ + "am.wilab2.ilabt.iminds.be" : "ops.wilab2.ilabt.iminds.be", + "nitlab.inf.uth.gr" : "nitlab.inf.uth.gr", + "nicta" : "??.??.??", }) -@clsinit +@clsinit_copy class OMFResource(ResourceManager): """ Generic resource gathering XMPP credential information and common methods for OMF nodes, channels, applications, etc. """ - _rtype = "OMFResource" + _rtype = "abstract::omf::Resource" + _platform = "omf" @classmethod def _register_attributes(cls): - xmppSlice = Attribute("xmppSlice","Name of the slice", + xmppServer = Attribute("xmppServer", "Xmpp Server", flags = Flags.Credential) - xmppHost = Attribute("xmppHost", "Xmpp Server", + xmppUser = Attribute("xmppUser","Name of the Xmpp User/Slice", flags = Flags.Credential) xmppPort = Attribute("xmppPort", "Xmpp Port", flags = Flags.Credential) xmppPassword = Attribute("xmppPassword", "Xmpp Password", flags = Flags.Credential) + version = Attribute("version", "Version of OMF : Either 5 or 6", + default = "6", ) - cls._register_attribute(xmppSlice) - cls._register_attribute(xmppHost) + cls._register_attribute(xmppUser) + cls._register_attribute(xmppServer) cls._register_attribute(xmppPort) cls._register_attribute(xmppPassword) + cls._register_attribute(version) def __init__(self, ec, guid): super(OMFResource, self).__init__(ec, guid)