[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
Changes by:	rmccabe sourceware org	2007-08-09 04:37:21

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

Log message:
	pull in fixes from the RHEL5 branch

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.206&r2=1.207
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_xvm_key.js.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.266&r2=1.267
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/form-macros.diff?cvsroot=cluster&r1=1.22&r2=1.23

--- conga/luci/cluster/form-macros	2007/08/08 21:00:06	1.206
+++ conga/luci/cluster/form-macros	2007/08/09 04:37:20	1.207
@@ -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:00:06	1.1
+++ conga/luci/cluster/validate_xvm_key.js	2007/08/09 04:37:20	1.2
@@ -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/StorageReport.py	2007/07/27 16:43:47	1.25
+++ conga/luci/site/luci/Extensions/StorageReport.py	2007/08/09 04:37:20	1.26
@@ -2060,7 +2060,7 @@
     length_in_bytes = 0
     for t in mapper_data['sources']:
         length_in_bytes += int(t['props']['size']['value'])
-    ppb = (length * 1.0) / length_in_bytes  # pixels per byte
+    ppb = (length * 1.0) / max(0.00001, length_in_bytes)  # pixels per byte
     lower_cyl['offset'] = int(lower_cyl['offset'] * ppb)
     for d in lower_cyl['cyls']:
         d['beg'] = int(d['beg'] * ppb)
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/08/08 21:26:37	1.266
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/08/09 04:37:20	1.267
@@ -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))
--- conga/luci/storage/form-macros	2007/06/27 08:14:22	1.22
+++ conga/luci/storage/form-macros	2007/08/09 04:37:21	1.23
@@ -896,7 +896,7 @@
    <div metal:use-macro="here/form-macros/macros/form-scripts"/>
    <span tal:omit-tag="" 
          tal:condition="not: mapper/new_sources">
-    There is no available <span tal:replace="mapper/pretty_sources_name"/> to be added to <span tal:replace="mapper/pretty_type"/> '<span tal:replace="mapper/pretty_name"/>'. 
+    There are no available <span tal:replace="mapper/pretty_sources_name"/> to be added to <span tal:replace="mapper/pretty_type"/> '<span tal:replace="mapper/pretty_name"/>'. 
      <br/>
      <br/>
     <a tal:define="go_to_mapper_url  python:'./?pagetype=52&mapper_type=' + mapper['mapper_type'] + '&mapper_id=' + mapper['mapper_id'] + '&storagename=' + storagename" 


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