[Cluster-devel] conga/luci cluster/form-macros site/luci/Exten ...
rmccabe at sourceware.org
rmccabe at sourceware.org
Thu Feb 15 22:44:03 UTC 2007
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-02-15 22:44:03
Modified files:
luci/cluster : form-macros
luci/site/luci/Extensions: ModelBuilder.py cluster_adapters.py
Log message:
Support modifying cluster totem parameters
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.188&r2=1.189
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ModelBuilder.py.diff?cvsroot=cluster&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.238&r2=1.239
--- conga/luci/cluster/form-macros 2007/02/14 15:04:34 1.188
+++ conga/luci/cluster/form-macros 2007/02/15 22:44:02 1.189
@@ -755,6 +755,16 @@
<tr class="systemsTable">
<td class="systemsTable">
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#send_join', 55, 65);">Maximum time to wait before sending a join message</a> (ms)
+ </td>
+ <td class="systemsTable">
+ <input type="text" size="10" name="send_join"
+ tal:attributes="value string:0" />
+ </td>
+ </tr>
+
+ <tr class="systemsTable">
+ <td class="systemsTable">
<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#consensus', 55, 65);">Consensus Timeout</a> (ms)
</td>
<td class="systemsTable">
--- conga/luci/site/luci/Extensions/ModelBuilder.py 2007/02/15 18:55:34 1.23
+++ conga/luci/site/luci/Extensions/ModelBuilder.py 2007/02/15 22:44:02 1.24
@@ -813,6 +813,12 @@
def getGULMPtr(self):
return self.GULM_ptr
+ def getCMANPtr(self):
+ return self.CMAN_ptr
+
+ def getTotemPtr(self):
+ return self.TOTEM_ptr
+
def getLockServer(self, name):
children = self.GULM_ptr.getChildren()
for child in children:
--- conga/luci/site/luci/Extensions/cluster_adapters.py 2007/02/13 19:50:58 1.238
+++ conga/luci/site/luci/Extensions/cluster_adapters.py 2007/02/15 22:44:02 1.239
@@ -34,6 +34,7 @@
from clusterOS import resolveOSType
from Fence import Fence
from Method import Method
+from Totem import Totem
from Device import Device
from FenceHandler import validateNewFenceDevice, FENCE_OPTS, validateFenceDevice, validate_fenceinstance
from GeneralError import GeneralError
@@ -1183,6 +1184,376 @@
luci_log.debug_verbose('unable to update general properties: %s' % str(e))
errors.append('Unable to update the cluster configuration.')
+ try:
+ cluster_version = form['cluster_version'].strip()
+ if cluster_version != 'rhel5':
+ raise Exception, 'not rhel5'
+ except:
+ if len(errors) > 0:
+ return (False, {'errors': errors})
+ return (True, {})
+
+ totem = model.getTotemPtr()
+ if totem is None:
+ cp = model.getClusterPtr()
+ totem = Totem()
+ cp.addChild(totem)
+
+ if form.has_key('secauth'):
+ totem.addAttribute('secauth', '1')
+ else:
+ totem.addAttribute('secauth', '0')
+
+ try:
+ rrp_mode = form['rrp_mode'].strip().lower()
+ if not rrp_mode:
+ raise KeyError, 'rrp_mode'
+ if rrp_mode != 'none' and rrp_mode != 'active' and 'rrp_mode' != 'passive':
+ raise Exception, '%s is an invalid value for redundant ring protocol mode' % rrp_mode
+ totem.addAttribute('rrp_mode', str(rrp_mode))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('rrp_mode')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ net_mtu = form['net_mtu'].strip()
+ if not net_mtu:
+ raise KeyError, 'net_mtu'
+ net_mtu = int(net_mtu)
+ if net_mtu < 1:
+ raise ValueError, '%d is an invalid value for network MTU' % net_mtu
+ totem.addAttribute('net_mtu', str(net_mtu))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('net_mtu')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ threads = form['threads'].strip()
+ if not threads:
+ raise KeyError, 'threads'
+ threads = int(threads)
+ if threads < 0:
+ raise ValueError, '%d is an invalid value for number of threads' % threads
+ totem.addAttribute('threads', str(threads))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('threads')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ vsftype = form['vsftype'].strip().lower()
+ if not vsftype:
+ raise KeyError, 'vsftype'
+ if vsftype != 'none' and vsftype != 'ykd':
+ raise ValueError, '%s is an invalid value for virtual synchrony type' % vsftype
+ totem.addAttribute('vsftype', str(vsftype))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('vsftype')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ token = form['token'].strip()
+ if not token:
+ raise KeyError, 'token'
+ token = int(token)
+ if token < 1:
+ raise ValueError, '%d is an invalid value for token timeout' % token
+ totem.addAttribute('token', str(token))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('token')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ token_retransmit = form['token_retransmit'].strip()
+ if not token_retransmit:
+ raise KeyError, 'token_retransmit'
+ token_retransmit = int(token_retransmit)
+ if token_retransmit < 1:
+ raise ValueError, '%d is an invalid value for token retransmit' % token_retransmit
+ totem.addAttribute('token_retransmit', str(token_retransmit))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('token_retransmit')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ hold = form['hold'].strip()
+ if not hold:
+ raise KeyError, 'hold'
+ hold = int(hold)
+ if hold < 1:
+ raise ValueError, '%d is not a valid value for hold token timeout' % hold
+ totem.addAttribute('hold', str(hold))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('hold')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ retransmits_before_loss = form['retransmits_before_loss'].strip()
+ if not retransmits_before_loss:
+ raise KeyError, 'retransmits_before_loss'
+ retransmits_before_loss = int(retransmits_before_loss)
+ if retransmits_before_loss < 1:
+ raise ValueError, '%d is an invalid value for number of retransmits before loss' % retransmits_before_loss
+ totem.addAttribute('retransmits_before_loss', str(retransmits_before_loss))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('retransmits_before_loss')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ join = form['join'].strip()
+ if not join:
+ raise KeyError, 'join'
+ join = int(join)
+ if join < 1:
+ raise ValueError, '%d is an invalid value for join timeout' % join
+ totem.addAttribute('join', str(join))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('join')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ send_join = form['send_join'].strip()
+ if not send_join:
+ raise KeyError, 'send_join'
+ send_join = int(send_join)
+ if send_join < 0:
+ raise ValueError, '%d is an invalid value for time to wait before sending a join message' % send_join
+ totem.addAttribute('send_join', str(send_join))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('send_join')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ consensus = form['consensus'].strip()
+ if not consensus:
+ raise KeyError, 'consensus'
+ consensus = int(consensus)
+ if consensus < 1:
+ raise ValueError, '%d is an invalid value for consensus timeout' % consensus
+ totem.addAttribute('consensus', str(consensus))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('consensus')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ merge = form['merge'].strip()
+ if not merge:
+ raise KeyError, 'merge'
+ merge = int(merge)
+ if merge < 1:
+ raise ValueError, '%d is an invalid value for merge detection timeout' % merge
+ totem.addAttribute('merge', str(merge))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('merge')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ downcheck = form['downcheck'].strip()
+ if not downcheck:
+ raise KeyError, 'downcheck'
+ downcheck = int(downcheck)
+ if downcheck < 1:
+ raise ValueError, '%d is an invalid value for interface down check timeout' % downcheck
+ totem.addAttribute('downcheck', str(downcheck))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('downcheck')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ fail_to_recv_const = form['fail_to_recv_const'].strip()
+ if not fail_to_recv_const:
+ raise KeyError, 'fail_to_recv_const'
+ fail_to_recv_const = int(fail_to_recv_const)
+ if fail_to_recv_const < 1:
+ raise ValueError, '%d is an invalid value for fail to receive constant' % fail_to_recv_const
+ totem.addAttribute('fail_to_recv_const', str(fail_to_recv_const))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('fail_to_recv_const')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ seqno_unchanged_const = form['seqno_unchanged_const'].strip()
+ if not seqno_unchanged_const:
+ raise KeyError, 'seqno_unchanged_const'
+ seqno_unchanged_const = int(seqno_unchanged_const)
+ if seqno_unchanged_const < 1:
+ raise ValueError, '%d is an invalid value for rotations with no multicast traffic before merge detection timeout started' % seqno_unchanged_const
+ totem.addAttribute('seqno_unchanged_const', str(seqno_unchanged_const))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('seqno_unchanged_const')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ heartbeat_failures_allowed = form['heartbeat_failures_allowed'].strip()
+ if not heartbeat_failures_allowed:
+ raise KeyError, 'heartbeat_failures_allowed'
+ heartbeat_failures_allowed = int(heartbeat_failures_allowed)
+ if heartbeat_failures_allowed < 0:
+ raise ValueError, '%d is an invalid value for number of heartbeat failures allowed' % heartbeat_failures_allowed
+ totem.addAttribute('heartbeat_failures_allowed', str(heartbeat_failures_allowed))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('heartbeat_failures_allowed')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ max_network_delay = form['max_network_delay'].strip()
+ if not max_network_delay:
+ raise KeyError, 'max_network_delay'
+ max_network_delay = int(max_network_delay)
+ if max_network_delay < 1:
+ raise ValueError, '%d is an invalid value for maximum network delay' % max_network_delay
+ totem.addAttribute('max_network_delay', str(max_network_delay))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('max_network_delay')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ window_size = form['window_size'].strip()
+ if not window_size:
+ raise KeyError, 'window_size'
+ window_size = int(window_size)
+ if window_size < 1:
+ raise ValueError, '%d is an invalid value for window size' % window_size
+ totem.addAttribute('window_size', str(window_size))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('window_size')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ max_messages = form['max_messages'].strip()
+ if not max_messages:
+ raise KeyError, 'max_messages'
+ max_messages = int(max_messages)
+ if max_messages < 1:
+ raise ValueError, '%d is an invalid value for maximum messages' % max_messages
+ totem.addAttribute('max_messages', str(max_messages))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('max_messages')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ rrp_problem_count_timeout = form['rrp_problem_count_timeout'].strip()
+ if not rrp_problem_count_timeout:
+ raise KeyError, 'rrp_problem_count_timeout'
+ rrp_problem_count_timeout = int(rrp_problem_count_timeout)
+ if rrp_problem_count_timeout < 1:
+ raise ValueError, '%d is an invalid value for RRP problem count timeout' % rrp_problem_count_timeout
+ totem.addAttribute('rrp_problem_count_timeout', str(rrp_problem_count_timeout))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('rrp_problem_count_timeout')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ rrp_problem_count_threshold = form['rrp_problem_count_threshold'].strip()
+ if not rrp_problem_count_threshold:
+ raise KeyError, 'rrp_problem_count_threshold'
+ rrp_problem_count_threshold = int(rrp_problem_count_threshold)
+ if rrp_problem_count_threshold < 1:
+ raise ValueError, '%d is an invalid value for RRP problem count threshold' % rrp_problem_count_threshold
+ totem.addAttribute('rrp_problem_count_threshold', str(rrp_problem_count_threshold))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('rrp_problem_count_threshold')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
+ try:
+ rrp_token_expired_timeout = form['rrp_token_expired_timeout'].strip()
+ if not rrp_token_expired_timeout:
+ raise KeyError, 'rrp_token_expired_timeout'
+ rrp_token_expired_timeout = int(rrp_token_expired_timeout)
+ if rrp_token_expired_timeout < 1:
+ raise ValueError, '%d is an invalid value for RRP token expired timeout' % rrp_token_expired_timeout
+ totem.addAttribute('rrp_token_expired_timeout', str(rrp_token_expired_timeout))
+ except KeyError, e:
+ try:
+ totem.removeAttribute('rrp_token_expired_timeout')
+ except:
+ pass
+ except Exception, e:
+ errors.append(str(e))
+
if len(errors) > 0:
return (False, {'errors': errors})
return (True, {})
@@ -2200,7 +2571,7 @@
try:
vm_path = request.form['vmpath'].strip()
if not vm_path:
- raise 'blank'
+ raise Exception, 'blank'
except Exception, e:
luci_log.debug_verbose('validateVM1: no vm path: %s' % str(e))
errors.append('No path to the virtual machine configuration file was given.')
More information about the Cluster-devel
mailing list