[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga/luci cluster/form-macros cluster/validat ...



CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe sourceware org	2007-08-09 04:34:53

Modified files:
	luci/cluster   : form-macros validate_xvm_key.js 
	luci/site/luci/Extensions: cluster_adapters.py 

Log message:
	minor cleanups for 230451 fix

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.90.2.28&r2=1.90.2.29
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_xvm_key.js.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.120.2.36&r2=1.120.2.37

--- conga/luci/cluster/form-macros	2007/08/08 21:18:46	1.90.2.28
+++ conga/luci/cluster/form-macros	2007/08/09 04:34:49	1.90.2.29
@@ -982,7 +982,7 @@
 
 				<tr id="fence_xvm_config" class="invisible">
 					<td class="systemsTable" colspan="2" id="fence_xvm_config">
-						<table class="systemsTable">
+						<table class="systemsTable" width="100%">
 							<tr class="systemsTable">
 								<td class="systemsTable">
 									<div id="fence_xvm_hosts" />
--- conga/luci/cluster/validate_xvm_key.js	2007/08/08 21:20:37	1.1.2.2
+++ conga/luci/cluster/validate_xvm_key.js	2007/08/09 04:34:51	1.1.2.3
@@ -12,16 +12,21 @@
 	var node_num = 0;
 
 	var hclu_elem = document.getElementById('host_cluster_name');
-	if (hclu_elem) {
+	if (hclu_elem && hclu_elem.value) {
 		++node_num;
 		url += '&node' + node_num + '=' + hclu_elem.value;
 	}
 	var vclu_elem = document.getElementById('virt_cluster_name');
-	if (vclu_elem) {
+	if (vclu_elem && vclu_elem.value) {
 		++node_num;
 		url += '&node' + node_num + '=' + vclu_elem.value;
 	}
-    initiate_async_get(url, cluster_member_callback);
+
+	if (!node_num) {
+		alert('No node names were entered');
+	} else {
+	    initiate_async_get(url, cluster_member_callback);
+	}
 }
 
 function cluster_member_callback() {
@@ -50,9 +55,15 @@
 		return;
 	}
 
-	obj = obj.responseXML;
+	try {
+		obj = obj.responseXML.getElementsByTagName('dict')[0];
+	} catch (e) {
+		alert('Received a malformed response from the luci server.');
+		return;
+	}
+
 	var clusters = [];
-	var dict_tags = obj.firstChild.getElementsByTagName('dict');
+	var dict_tags = obj.getElementsByTagName('dict');
 	for (var i = 0 ; i < dict_tags.length ; i++) {
 		try {
 			var cnode_names = [];
@@ -81,31 +92,33 @@
 	for (var i = 0 ; i < clusters.length ; i++) {
 		var cnode_list = clusters[i][1];
 
-		var div = document.createElement('div');
-		var p = document.createElement('p');
 		var span = document.createElement('strong');
-		var ul = document.createElement('ul');
-
-		p.className = 'cluster';
 		span.className = 'cluster';
-		span.textContent = 'Cluster: ' + clusters[i][0];
 
-		p.appendChild(span);
-		div.appendChild(p);
+		var txtnode = document.createTextNode('Cluster: ' + clusters[i][0]);
+		span.appendChild(txtnode);
+
+		var ul = document.createElement('ul');
+		ul.className = 'vanilla';
 
 		for (var j = 0 ; j < cnode_list.length ; j++) {
 			var li = document.createElement('li');
 			var input = document.createElement('input');
-			var lispan = document.createElement('span');
+			var litxt = document.createTextNode(cnode_list[j]);
+
 			input.type = 'checkbox';
 			input.name = '__NODE_HOSTNAME__';
 			input.value = cnode_list[j];
 			input.checked = 'checked';
-			lispan.textContent = cnode_list[j];
+
 			li.appendChild(input);
-			li.appendChild(lispan);
+			li.appendChild(litxt);
 			ul.appendChild(li);
 		}
+
+		var div = document.createElement('div');
+		div.className = 'fence';
+		div.appendChild(span);
 		div.appendChild(ul);
 		xvm_div_elem.appendChild(div);
 	}
@@ -115,5 +128,9 @@
 		form_elem.pagetype.value = '60';
 		fc_elem.className = 'invisible';
 		xvm_hidden_elem.className = 'systemsTable';
+		var applyelem = document.getElementById('fence_config_submit');
+		if (applyelem) {
+			applyelem.disabled = true;
+		}
 	}
 }
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/08/08 21:14:38	1.120.2.36
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/08/09 04:34:52	1.120.2.37
@@ -27,8 +27,6 @@
 from homebase_adapters import parseHostForm
 from LuciClusterActions import propagateClusterConfAsync
 
-from LuciZopeAsync import get_cluster_nodes_async
-
 from LuciClusterInfo import getClusterInfo, \
 	getModelBuilder, LuciExtractCluModel
 
@@ -2171,8 +2169,8 @@
 				luci_log.info('Setting fence_xvm key for node "%s" failed' % i)
 			continue
 
-		set_node_flag(self, clustername, i, batch_num,
-			FENCE_XVM_KEY_CREATE, 'Creating a fence_xvm key file')
+		set_node_flag(self, clustername, i, batch_num, FENCE_XVM_KEY_CREATE,
+			'Creating fence_xvm key file for host "%s"' % i)
 
 	request.RESPONSE.redirect('%s?pagetype=%s&clustername=%s&tab=2&busyfirst=true' \
 		% (baseurl, CLUSTER_CONFIG, clustername))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]