From: Thierry Parmentelat Date: Fri, 12 Mar 2010 10:19:48 +0000 (+0000) Subject: expose node hrn to the OMF resource controller X-Git-Tag: PLCAPI-5.0-3^2~11 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=fbdeb52c3d9b888fbf4f964e1481897fb9495472;p=plcapi.git expose node hrn to the OMF resource controller --- diff --git a/PLC/Accessors/Accessors_standard.py b/PLC/Accessors/Accessors_standard.py index a5f42d9d..774903c5 100644 --- a/PLC/Accessors/Accessors_standard.py +++ b/PLC/Accessors/Accessors_standard.py @@ -66,6 +66,11 @@ define_accessors(current_module, Node, "Deployment", "deployment", define_accessors(current_module, Node, "Extensions", "extensions", "node/config", "space-separated list of extensions to install", get_roles=all_roles, set_roles=["admin"],expose_in_api=True) +# access HRN +define_accessors(current_module, Node, "Hrn","hrn", + "node/sfa", "SFA human readable name", + get_roles=all_roles, set_roles=["admin"], expose_in_api=True) + # test nodes perform their installation from an uncompressed bootstrapfs define_accessors(current_module, Node, "PlainBootstrapfs", "plain-bootstrapfs", "node/config", "use uncompressed bootstrapfs when set", diff --git a/PLC/Methods/GetSlivers.py b/PLC/Methods/GetSlivers.py index 2d201b94..98fd4256 100644 --- a/PLC/Methods/GetSlivers.py +++ b/PLC/Methods/GetSlivers.py @@ -20,6 +20,8 @@ from PLC.SliceTags import SliceTag, SliceTags from PLC.InitScripts import InitScript, InitScripts from PLC.Methods.GetSliceFamily import GetSliceFamily +from PLC.Accessors.Accessors_standard import * + # XXX used to check if slice expiration time is sane MAXINT = 2L**31-1 @@ -281,7 +283,7 @@ class GetSlivers(Method): personsitekeys=get_all_admin_keys(self.api) accounts.append({'name':'root','keys':personsitekeys}) - node.update_last_contact() + hrn = GetNodeHrn(self.api).call(auth,node['node_id']) # XMPP config for omf federation try: @@ -294,6 +296,8 @@ class GetSlivers(Method): except: xmpp={'server':None,'user':None,'password':None} + node.update_last_contact() + return { 'timestamp': timestamp, 'node_id': node['node_id'], @@ -305,4 +309,5 @@ class GetSlivers(Method): 'slivers': slivers, 'accounts': accounts, 'xmpp':xmpp, + 'hrn':hrn, } diff --git a/db-config.d/010-node_tags b/db-config.d/010-node_tags index 6e835e70..c25230db 100644 --- a/db-config.d/010-node_tags +++ b/db-config.d/010-node_tags @@ -8,8 +8,8 @@ nodetag_types = \ [ # Node HRN (SFA specific human readable name) {'tagname': 'hrn', - 'description': 'SFA specific human readable name', - 'category' : 'sfa/general', + 'description': 'SFA human readable name', + 'category' : 'node/sfa', 'min_role_id': 10}, ]