Skip to contentSkip to conversation

conga/luci cluster/form-macros cluster/resourc ...

Cluster-devel [email protected] 1 participant 1 message May 30, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Branch: EXPERIMENTAL
Changes by: rmccabe at sourceware.org 2007-05-30 05:54:03

Modified files:
luci/cluster : form-macros resource-form-macros
luci/logs : log_provider
luci/site/luci/Extensions: LuciClusterActions.py LuciDB.py
LuciZopeExternal.py RicciQueries.py cluster_adapters.py conga_constants.py homebase_adapters.py
luci/site/luci/Extensions/ClusterModel: ModelBuilder.py

Log message:
- More cleanups
- Sort log entries chronologically

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.198.2.2&r2=1.198.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.37&r2=1.37.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/logs/log_provider.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1&r2=1.1.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterActions.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.6&r2=1.1.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciDB.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.12&r2=1.1.2.13
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeExternal.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/RicciQueries.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.5&r2=1.1.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.255.2.10&r2=1.255.2.11
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.39.2.4&r2=1.39.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.50.2.7&r2=1.50.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.5&r2=1.1.2.6

luci/cluster/form-macros +7 -2
@@ -3627,7 +3627,7 @@
 <div metal:define-macro="nodelogs-form">
 	<h2>Recent Log Activity for <span tal:replace="request/nodename"/></h2>
 	<hr/>
-	<span tal:replace="structure python: here.getLogsForNode(request)"/>
+	<span tal:replace="structure python: here.getSystemLogs(request)"/>
 </div>
 
 <div metal:define-macro="nodeadd-form">
@@ -4660,7 +4660,12 @@
 
 <div metal:define-macro="servicedelete-form">
 	<h2>Service Delete Form</h2>
-	<tal:block tal:define="dummy python: here.delService(request)" />
+
+	<tal:block tal:define="
+		global ricci_agent ri_agent | python: here.getRicciAgentForCluster(request)" />
+
+	<span tal:define="
+		result python: here.serviceDelete(ricci_agent, request)" />
 </div>
 
 <div metal:define-macro="resources-form">
luci/cluster/resource-form-macros +1 -1
@@ -92,7 +92,7 @@
 	<h2>Resources Remove Form</h2>
 
 	<tal:block tal:define="
-		msg python: here.delResource(here.getRicciAgentForCluster(request), request)">
+		msg python: here.deleteResource(here.getRicciAgentForCluster(request), request)">
 		<span class="error" tal:condition="msg" tal:content="msg" />
 	</tal:block>
 </div>
luci/logs/log_provider +1 -1
@@ -1 +1 @@
-<pre tal:content="structure python: here.getLogsForNode(request)"></pre>
+<pre tal:content="structure python: here.getSystemLogs(request)"></pre>
luci/site/luci/Extensions/Attic/LuciClusterActions.py +159 -275

608 lines not on this page · raw message

luci/site/luci/Extensions/Attic/LuciDB.py +61 -22

143 lines not on this page · raw message

luci/site/luci/Extensions/Attic/LuciZopeExternal.py +9 -3
@@ -5,12 +5,18 @@
 # GNU General Public License as published by the
 # Free Software Foundation.
 
+#
+# The only purpose of this file is to aggregate all the functions
+# called by Zope External Methods.
+#
+
 from homebase_adapters import getUserPerms, homebaseControl, \
 	getDefaultUser
 
-from cluster_adapters import addResource, clusterTaskProcess, \
-	createCluChooser, createCluConfigTree, delResource, delService, \
-	getClusterOS, getClusterURL, getLogsForNode, getRicciAgentForCluster, \
+from cluster_adapters import clusterTaskProcess, resourceAdd, \
+	resourceDelete, \
+	createCluChooser, createCluConfigTree, serviceDelete, \
+	getClusterOS, getClusterURL, getSystemLogs, getRicciAgentForCluster, \
 	isClusterBusy, nodeTaskProcess, process_cluster_conf_editor, \
 	serviceMigrate, serviceRestart, serviceStart, serviceStop
 
luci/site/luci/Extensions/Attic/RicciQueries.py +7 -0
@@ -399,6 +399,13 @@
 
 	time_now = time()
 	entry_list = list()
+
+	try:
+		# Show older entries first.
+		log_entries.sort(lambda x, y: int(y.getAttribute('age')) - int(x.getAttribute('age')))
+	except:
+		pass
+
 	for i in log_entries:
 		try:
 			log_msg = i.getAttribute('msg')
luci/site/luci/Extensions/cluster_adapters.py +80 -86

344 lines not on this page · raw message

luci/site/luci/Extensions/conga_constants.py +0 -5
@@ -142,11 +142,6 @@
 
 REDIRECT_MSG = ' -- You will be redirected in 5 seconds.'
 
-# Cluster node exception attribute flags
-CLUSTER_NODE_NEED_AUTH	= 0x01
-CLUSTER_NODE_NOT_MEMBER	= 0x02
-CLUSTER_NODE_ADDED		= 0x04
-
 # Debugging parameters. Set LUCI_DEBUG_MODE to True and LUCI_DEBUG_VERBOSITY
 # to >= 2 to get full debugging output in syslog (LOG_DAEMON/LOG_DEBUG).
 
luci/site/luci/Extensions/homebase_adapters.py +3 -2
@@ -5,7 +5,7 @@
 # GNU General Public License as published by the
 # Free Software Foundation.
 
-from conga_constants import PLONE_ROOT, CLUSTER_NODE_NEED_AUTH, \
+from conga_constants import PLONE_ROOT, \
 	STORAGE_FOLDER_PATH, CLUSTER_FOLDER_PATH, LUCI_DEBUG_MODE
 
 from RicciQueries import getClusterConf
@@ -14,7 +14,8 @@
 
 from LuciDB import delCluster, clearNodeStatus, delSystem, \
 	getClusterNode, getClusters, getStorage, getStorageNode, \
-	manageCluster
+	manageCluster, \
+	CLUSTER_NODE_NEED_AUTH
 
 from LuciZopePerm import havePermAddCluster, havePermRemCluster, \
 	havePermAddUser, havePermDelUser, havePermEditPerms, \
luci/site/luci/Extensions/ClusterModel/Attic/ModelBuilder.py +5 -5
@@ -544,12 +544,12 @@
     self.isModified = True
 
   def retrieveNodeByName(self, name):
-    nodes = self.getNodes()
-    for node in nodes:
-      if node.getName() == name:
-        return node
+    ret = filter(lambda x: x.getName() == name, self.getNodes())
+    if len(ret) != 1:
+      raise KeyError, name
 
-    raise GeneralError('FATAL', "Couldn't find node name in current node list")
+  def deleteNodeByName(self, name):
+    return self.deleteNode(self.retrieveNodeByName(name))
 
   def retrieveServiceByName(self, name):
     svcs = self.getServices()