From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 7 Feb 2008 06:53:28 -0000 Subject: [Cluster-devel] conga ./conga.spec.in.in luci/cluster/resource ... Message-ID: <20080207065328.7693.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Branch: RHEL5 Changes by: rmccabe at sourceware.org 2008-02-07 06:53:23 Modified files: . : conga.spec.in.in luci/cluster : resource_form_handlers.js validate_config_multicast.js luci/homebase : form-macros validate_cluster_add_initial.js validate_user_add.js luci/init.d : luci luci/plone-custom: conga.js footer luci.css luci/site/luci/Extensions: LuciDB.py LuciValidation.py LuciZopeAsync.py homebase_adapters.py luci/site/luci/Extensions/ClusterModel: ClusterNode.py ModelBuilder.py luci/site/luci/var: Data.fs make : version.in Log message: backport fixes from HEAD for 431105 Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.66&r2=1.45.2.67 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.13&r2=1.20.2.14 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_config_multicast.js.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.3&r2=1.3.2.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.44.2.12&r2=1.44.2.13 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/validate_cluster_add_initial.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/homebase/validate_user_add.js.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.2&r2=1.3.2.3 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/init.d/luci.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.11.2.3&r2=1.11.2.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/conga.js.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.4&r2=1.3.2.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/footer.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.3&r2=1.2.2.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/luci.css.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.1&r2=1.4.2.2 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciDB.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.7&r2=1.1.4.8 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciValidation.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.1&r2=1.6.2.2 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeAsync.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.3&r2=1.1.2.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.34.2.15&r2=1.34.2.16 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ClusterNode.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.2&r2=1.1.4.3 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.6&r2=1.1.4.7 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/var/Data.fs.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.15.2.27&r2=1.15.2.28 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/make/version.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.21.2.31&r2=1.21.2.32 --- conga/conga.spec.in.in 2008/01/29 22:02:12 1.45.2.66 +++ conga/conga.spec.in.in 2008/02/07 06:52:55 1.45.2.67 @@ -292,6 +292,9 @@ ### changelog ### %changelog +* Wed Feb 06 2008 Ryan McCabe 0.12.0-3 +- Fix bz431105 (IP Address Resource configuration: cannot enter fully qualified hostname) + * Mon Jan 28 2008 Ryan McCabe 0.12.0-2 - Fix bz430737 (Conga should install the 'cmirror' package when clustered storage is requested) --- conga/luci/cluster/resource_form_handlers.js 2008/01/23 04:44:30 1.20.2.13 +++ conga/luci/cluster/resource_form_handlers.js 2008/02/07 06:52:55 1.20.2.14 @@ -101,12 +101,13 @@ } var ipstr = form.ip_address.value; - var err = isValidHost(ipstr); + var err = isValidHost(ipstr, true); if (err) { errors.push('Error: \"' + ipstr + '\": ' + err); set_form_err(form.ip_address); - } else + } else { clr_form_err(form.ip_address); + } return (errors); } --- conga/luci/cluster/validate_config_multicast.js 2008/01/23 04:44:30 1.3.2.3 +++ conga/luci/cluster/validate_config_multicast.js 2008/02/07 06:52:55 1.3.2.4 @@ -74,9 +74,9 @@ errors.push('No multicast address was given.'); set_form_err(form.mcast_address); } else { - var err = isValidHost(form.mcast_address.value); + var err = isValidHost(form.mcast_address.value, true); if (err) { - errors.push(err); + errors.push('Error: \"' + form.mcast_address.value + '\": ' + err); set_form_err(form.mcast_address); } clr_form_err(form.mcast_address); --- conga/luci/homebase/form-macros 2008/01/23 04:44:31 1.44.2.12 +++ conga/luci/homebase/form-macros 2008/02/07 06:52:56 1.44.2.13 @@ -219,7 +219,7 @@ tal:define="cfname python: here.strFilter('[^0-9A-Za-z_-]', '_', c)" tal:attributes="id python: cfname"> - Storage Systems
- - +
--- conga/luci/homebase/validate_cluster_add_initial.js 2008/01/23 04:44:31 1.1.2.2 +++ conga/luci/homebase/validate_cluster_add_initial.js 2008/02/07 06:52:56 1.1.2.3 @@ -32,7 +32,9 @@ if (form.pagetype.value == 7) { if (confirm('Retrieve cluster information from ' + added_storage[0] + '?')) { - get_cluster_members(); + form.pagetype.value = 1000; + get_cluster_members(form); + form.pagetype.value = 7; } } else if (form.pagetype.value == 6) { if (confirm('Add this cluster?')) { @@ -62,7 +64,7 @@ return false; } -function get_cluster_members() { +function get_cluster_members(form) { var url = '/luci/cluster?pagetype=1000'; var node_num = 0; @@ -73,9 +75,9 @@ } if (!node_num) { - alert('No node names were entered'); + alert('No node hostname was entered'); } else { - initiate_async_get(url, cluster_member_callback); + initiate_async_post(form, url, cluster_member_callback); } } --- conga/luci/homebase/validate_user_add.js 2008/01/23 04:44:31 1.3.2.2 +++ conga/luci/homebase/validate_user_add.js 2008/02/07 06:52:56 1.3.2.3 @@ -34,8 +34,8 @@ if (str_is_blank(form.newPassword.value)) { errors.push('Passwords may not be blank.'); set_form_err(form.newPassword); - } else if (form.newPassword.value.length < 5) { - errors.push('Passwords must be at least five characters long.'); + } else if (form.newPassword.value.length < 6) { + errors.push('Passwords must be@least six characters long.'); set_form_err(form.newPassword); } --- conga/luci/init.d/luci 2008/01/23 04:44:31 1.11.2.3 +++ conga/luci/init.d/luci 2008/02/07 06:52:56 1.11.2.4 @@ -73,12 +73,12 @@ old_umask=`umask` umask 077 - rm -f "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY" + rm -f -- "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY" /usr/bin/openssl genrsa -out "$HTTPS_PRIVKEY" "$KEY_BITS" >&/dev/null /usr/bin/openssl req -new -x509 -key "$HTTPS_PRIVKEY" -out "$HTTPS_PUBKEY" -days "$KEY_LIFE_DAYS" -config /var/lib/luci/var/certs/cacert.config - /bin/chmod 600 "$HTTPS_PRIVKEY" - /bin/chmod 644 "$HTTPS_PUBKEY" - /bin/chown $LUCI_USER:$LUCI_GROUP "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY" + /bin/chmod -- 600 "$HTTPS_PRIVKEY" + /bin/chmod -- 644 "$HTTPS_PUBKEY" + /bin/chown -- $LUCI_USER:$LUCI_GROUP "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY" ret=$? umask $old_umask @@ -88,7 +88,7 @@ stop_luci() { - pid_num=`cat $PIDFILE 2>/dev/null` + pid_num=`cat -- $PIDFILE 2>/dev/null` ret=$? if [ $ret -eq 0 ]; then kill $pid_num >& /dev/null @@ -96,7 +96,7 @@ fi if [ $ret -ne 0 ]; then - pkill -u "$LUCI_USER" python >&/dev/null + pkill -u "$LUCI_USER" -- python >&/dev/null ret=$? fi return $ret @@ -104,7 +104,7 @@ stop_stunnel() { - pid_num=`cat $STUNNEL_PID 2>/dev/null` + pid_num=`cat -- $STUNNEL_PID 2>/dev/null` ret=$? if [ $ret -eq 0 ]; then kill $pid_num >& /dev/null @@ -112,7 +112,7 @@ fi if [ $ret -ne 0 ]; then - pkill -u "$LUCI_USER" stunnel >&/dev/null + pkill -u "$LUCI_USER" -- stunnel >&/dev/null ret=$? fi return $ret @@ -121,11 +121,34 @@ stop() { stop_stunnel + max_wait=5 + cur_wait=0 + while [ $cur_wait -lt $max_wait ]; do + sleep 1 + cur_wait=`expr $cur_wait + 1` + stunnel_running + if [ $? -eq 0 ]; then + break + fi + done + if [ $? -ne 0 ]; then errmsg='Failed to stop stunnel' return 1 fi + stop_luci + max_wait=10 + cur_wait=0 + while [ $cur_wait -lt $max_wait ]; do + sleep 1 + cur_wait=`expr $cur_wait + 1` + luci_running + if [ $? -eq 0 ]; then + break + fi + done + if [ $? -ne 0 ]; then errmsg='Failed to stop luci' return 1 @@ -145,43 +168,83 @@ fi sh $LUCID >&/dev/null & - sleep 4 + + cur_wait=0 + max_wait=10 + luci_running + ret=$? + while [ $ret -ne 1 ] && [ $cur_wait -lt $max_wait ]; do + sleep 1 + cur_wait=`expr $cur_wait + 1` + luci_running + ret=$? + done + + if [ $ret -ne 1 ]; then + errmsg='An error occurred while starting luci' + stop_luci + return 1 + fi sed -e s,\\\(^accept.*=\ \\\)\\\(.*\\\),\\\1$LUCI_HTTPS_PORT, $STUNNEL_CONF | $STUNNEL_D -fd 0 if [ $? -ne 0 ]; then errmsg='An error occurred while starting stunnel' - stop_luci + stop_luci >& /dev/null + return 1 + fi + + max_wait=5 + cur_wait=0 + stunnel_running + ret=$? + while [ $ret -ne 2 ] && [ $cur_wait -lt $max_wait ]; do + sleep 1 + cur_wait=`expr $cur_wait + 1` + stunnel_running + ret=$? + done + + if [ $ret -ne 2 ]; then + errmsg='An error occurred while starting stunnel' + stop_luci >& /dev/null + stop_stunnel >& /dev/null return 1 fi + return 0 } luci_running() { LUCI_UP=1 - pgrep -u "$LUCI_USER" python >&/dev/null - if [ $? -ne 0 ]; then + + test -f "$PIDFILE" + LUCI_PID_EXISTS=$? + if [ "$LUCI_PID_EXISTS" -eq 0 ]; then + pgrep -u "$LUCI_USER" -- python >&/dev/null + if [ $? -ne 0 ]; then + LUCI_UP=0 + # remove stale pidfile + rm -f -- "$PIDFILE" >& /dev/null + fi + else LUCI_UP=0 fi - if [ -f "$PIDFILE" ] && [ $LUCI_UP -eq 0 ]; then - # stale pidfile - rm -f "$PIDFILE" >& /dev/null - fi return $LUCI_UP } stunnel_running() { ST_UP=2 - pgrep -u "$LUCI_USER" stunnel >&/dev/null + pgrep -u "$LUCI_USER" -- stunnel >&/dev/null if [ $? -ne 0 ]; then ST_UP=0 fi if [ -f "$STUNNEL_PID" ] && [ $ST_UP -eq 0 ]; then # stale pidfile - rm -f "$STUNNEL_PID" + rm -f -- "$STUNNEL_PID" fi return $ST_UP } @@ -227,7 +290,7 @@ echo "The admin user password must be set before the luci can start" echo "To set it, execute (as root): " echo -e "\tluci_admin password\n" - /usr/bin/logger -t "$ID" "Luci startup failed: admin password not set (execute 'luci_admin password')" + /usr/bin/logger -t "$ID" -- "Luci startup failed: admin password not set (execute 'luci_admin password')" exit 6 fi @@ -243,24 +306,24 @@ exit 0 elif [ $ret -gt 2 ]; then # one of the two processes was running and couldn't be stopped. - /usr/bin/logger -t "$ID" "Luci startup failed: $errmsg" + /usr/bin/logger -t "$ID" -- "Luci startup failed: $errmsg" exit 1 fi system_running if [ $? -eq 1 ]; then echo_success - cat "$PIDFILE" > "$GLOB_PIDFILE" - touch "$GLOB_LOCKFILE" - /usr/bin/logger -t "$ID" "Luci startup succeeded" - /usr/bin/logger -t "$ID" "Listening on port $LUCI_HTTPS_PORT; accessible via URL $LUCI_URL" + cat -- "$PIDFILE" > "$GLOB_PIDFILE" + touch -- "$GLOB_LOCKFILE" + /usr/bin/logger -t "$ID" -- "Luci startup succeeded" + /usr/bin/logger -t "$ID" -- "Listening on port $LUCI_HTTPS_PORT; accessible via URL $LUCI_URL" echo; echo echo "Point your web browser to $LUCI_URL to access luci" echo exit 0 else echo_failure - /usr/bin/logger -t "$ID" "Luci startup failed $errmsg" + /usr/bin/logger -t "$ID" -- "Luci startup failed $errmsg" echo exit 1 fi @@ -269,7 +332,7 @@ restart) $0 stop rtrn=$? - if [ $rtrn -eq 0 ] || [ $rtrn -eq 7 ]; then + if [ $rtrn -eq 0 ]; then $0 start rtrn=$? fi @@ -302,16 +365,16 @@ if [ $rtrn -eq 1 ]; then stop if [ $? -eq 0 ]; then - rm -f "$GLOB_PIDFILE" - rm -f "$GLOB_LOCKFILE" - /usr/bin/logger -t "$ID" "Luci shutdown succeeded" + rm -f -- "$GLOB_PIDFILE" + rm -f -- "$GLOB_LOCKFILE" + /usr/bin/logger -t "$ID" -- "Luci shutdown succeeded" rtrn=0 else - /usr/bin/logger -t "$ID" "Luci shutdown failed" + /usr/bin/logger -t "$ID" -- "Luci shutdown failed" rtrn=1 fi elif [ $rtrn -eq 0 ]; then - rtrn=7 + rtrn=0 else rtrn=1 fi @@ -324,6 +387,10 @@ echo ;; + try-restart) + rtrn=3 + ;; + reload) rtrn=3 ;; --- conga/luci/plone-custom/conga.js 2008/01/23 04:44:31 1.3.2.4 +++ conga/luci/plone-custom/conga.js 2008/02/07 06:52:56 1.3.2.5 @@ -196,18 +196,22 @@ } } -function isValidHost(str) { +function isValidHost(str, iponly) { var i = str.split('.'); if (i.length === 1) { - return ('Hostnames must be fully qualified.'); + if (iponly) { + return ('You must enter an IP address in quad-dot notation.'); + } else { + return ('Hostnames must be fully qualified.'); + } } - if (i.length === 4 && !isNaN(parseInt(i[3]))) { - var o1 = parseInt(i[0]); - var o2 = parseInt(i[1]); - var o3 = parseInt(i[2]); - var o4 = parseInt(i[3]); + if (i.length === 4 && !isNaN(parseInt(i[3], 10))) { + var o1 = parseInt(i[0], 10); + var o2 = parseInt(i[1], 10); + var o3 = parseInt(i[2], 10); + var o4 = parseInt(i[3], 10); if (isNaN(o1) || isNaN(o2) || isNaN(o3) || ((o1 & 0xff) !== o1) || @@ -215,17 +219,21 @@ ((o3 & 0xff) !== o3) || ((o4 & 0xff) !== o4)) { - return ('Invalid IP Address.'); + return ('Invalid IP address.'); } return (null); } - if (!isNaN(parseInt(i[i.length - 1]))) { - return ('Invalid IP Address.'); + if (!isNaN(parseInt(i[i.length - 1], 10))) { + return ('Invalid IP address.'); + } + + if (iponly) { + return ('You must enter an IP address in quad-dot notation.'); } - if (!str.match(/^[0-9A-Za-z][0-9A-Za-z.-]*$/)) { + if (!str.match(/^[0-9A-Za-z][0-9A-Za-z.\-]*$/)) { return ('Hostnames can contain only alphanumeric characters and hyphens.'); } --- conga/luci/plone-custom/footer 2008/01/23 04:44:31 1.2.2.3 +++ conga/luci/plone-custom/footer 2008/02/07 06:52:56 1.2.2.4 @@ -10,13 +10,7 @@ Conga Cluster and Storage Management System is Copyright - - © - - 2000— + © 2000–2008 Red Hat, Inc.

--- conga/luci/plone-custom/luci.css 2008/01/23 04:44:31 1.4.2.1 +++ conga/luci/plone-custom/luci.css 2008/02/07 06:52:56 1.4.2.2 @@ -32,6 +32,10 @@ margin-right: +.3333em; } +input.blank { + margin: 0px .3333em 0px .3333em ! important; +} + td.pad_right { padding-right: +.6666em; } --- conga/luci/site/luci/Extensions/LuciDB.py 2008/01/25 17:18:38 1.1.4.7 +++ conga/luci/site/luci/Extensions/LuciDB.py 2008/02/07 06:52:56 1.1.4.8 @@ -384,7 +384,7 @@ try: newCluster.manage_acquiredPermissions([]) - newCluster.manage_role('View', ['Access Contents Information', 'View']) + newCluster.manage_role('View', ['Access contents information', 'View']) except Exception, e: if LUCI_DEBUG_MODE is True: luci_log.debug_verbose('MC3: %s: %r %s' % (clustername, e, str(e))) @@ -773,7 +773,7 @@ try: user = getSecurityManager().getUser() - if user.has_permission('View', cluster[1]): + if user.has_permission('View', cluster): return True except Exception, e: if LUCI_DEBUG_MODE is True: @@ -789,28 +789,29 @@ return allowed.has_key(hostname) def getRicciAgent(self, clustername, exclude_names=None, exclude_busy=False): - try: - perm = cluster_permission_check(self, clustername) - if not perm: - if LUCI_DEBUG_MODE is True: - luci_log.debug_verbose('GRA0: no permission for %s' \ - % clustername) - return None - except Exception, e: - if LUCI_DEBUG_MODE is True: - luci_log.debug_verbose('GRA0: %r %s' % (e, str(e))) - return None - clusterfolder = None try: path = str('%s%s' % (CLUSTER_FOLDER_PATH, clustername)) clusterfolder = self.restrictedTraverse(path) if not clusterfolder: if LUCI_DEBUG_MODE is True: - luci_log.debug('GRA1: cluster folder %s for %s is missing' \ + luci_log.debug('GRA0: cluster folder %s for %s is missing' \ % (path, clustername)) return None + try: + perm = cluster_permission_check(self, clusterfolder) + if not perm: + if LUCI_DEBUG_MODE is True: + luci_log.debug_verbose('GRA1: no permission for %s' \ + % clustername) + return None + except Exception, e1: + if LUCI_DEBUG_MODE is True: + luci_log.debug_verbose('GRA2: %s: %r %s' \ + % (clustername, e1, str(e1))) + return None + nodes = clusterfolder.objectItems('Folder') if len(nodes) < 1: if LUCI_DEBUG_MODE is True: --- conga/luci/site/luci/Extensions/LuciValidation.py 2008/01/23 04:44:32 1.6.2.1 +++ conga/luci/site/luci/Extensions/LuciValidation.py 2008/02/07 06:52:56 1.6.2.2 @@ -81,12 +81,12 @@ levels = node.getFenceLevels() try: - method_id = levels[fence_level - 1].getAttribute('name') + method_id = levels[min(1, fence_level - 1)].getAttribute('name') if not method_id: raise Exception, 'No method ID' fence_method = Method() fence_method.addAttribute('name', str(method_id)) - levels[fence_level - 1] = fence_method + levels[min(1, fence_level - 1)] = fence_method except Exception, e: method_id = fence_level fence_method = Method() @@ -102,7 +102,7 @@ break if delete_target is not None: try: - node.getChildren()[0].removeChild(delete_target) + node.getFenceNode().removeChild(delete_target) except Exception, e: if LUCI_DEBUG_MODE is True: luci_log.debug_verbose('vNFC9: %s: %r %s' \ @@ -251,23 +251,17 @@ continue fence_method.addChild(retobj) - if len(node.getChildren()) > 0: - # There's already a block - found_target = False - for idx in xrange(len(levels)): - if levels[idx].getAttribute('name') == method_id: - found_target = True - break - - if found_target is False: - # There's a fence block, but no relevant method - # block - node.getChildren()[0].addChild(fence_method) - else: - # There is no tag under the node yet. - fence_node = Fence() + fence_node = node.getFenceNode() + found_target = False + for idx in xrange(len(levels)): + if levels[idx].getAttribute('name') == method_id: + found_target = True + break + + if found_target is False: + # There's a fence block, but no relevant method + # block fence_node.addChild(fence_method) - node.addChild(fence_node) if len(errors) > 0: return (False, {'errors': errors }) --- conga/luci/site/luci/Extensions/LuciZopeAsync.py 2008/01/23 04:44:32 1.1.2.3 +++ conga/luci/site/luci/Extensions/LuciZopeAsync.py 2008/02/07 06:52:56 1.1.2.4 @@ -96,13 +96,21 @@ from LuciClusterInfo import getClusterConfNodes from RicciQueries import getClusterConf - fvars = GetReqVars(request, [ 'QUERY_STRING' ]) + fvars = GetReqVars(request, [ 'QUERY_STRING', '__SYSTEM0' ]) if fvars['QUERY_STRING'] is None: if LUCI_DEBUG_MODE is True: luci_log.debug_verbose('GCNA0: No query string was given') write_err_async(request, 'No node names were given') return None + conf_node_pair = fvars['__SYSTEM0'] + if conf_node_pair is not None and len(conf_node_pair) == 2: + conf_node = conf_node_pair[0] + conf_node_passwd = conf_node_pair[1] + else: + conf_node = None + conf_node_passwd = None + try: nodes = fvars['QUERY_STRING'].split('&') node_list = map(lambda x: x[1], filter(lambda x: x[0][:4] == 'node', map(lambda x: x.split('='), nodes))) @@ -118,7 +126,15 @@ ret = {} for node_host in node_list: try: - rc = RicciCommunicator(node_host) + if node_host == conf_node: + rc = RicciCommunicator(node_host, enforce_trust=False) + rc.trust() + rc.auth(conf_node_passwd) + if not rc.authed(): + errors.append('Authentication to node %s failed' % conf_node) + break + else: + rc = RicciCommunicator(node_host) cluster_name = rc.cluster_info()[0] if not cluster_name: errors.append('%s is not a member of a cluster' \ --- conga/luci/site/luci/Extensions/homebase_adapters.py 2008/01/23 04:44:32 1.34.2.15 +++ conga/luci/site/luci/Extensions/homebase_adapters.py 2008/02/07 06:52:56 1.34.2.16 @@ -133,6 +133,9 @@ passwd = request.form['newPassword'] pwconfirm = request.form['newPasswordConfirm'] + if len(passwd) < 6: + return (False, { 'errors': [ 'Passwords must be@least six characters long.' ] }) + if passwd != pwconfirm: return (False, { 'errors': [ 'The passwords given do not match' ]}) --- conga/luci/site/luci/Extensions/ClusterModel/ClusterNode.py 2008/01/23 04:44:33 1.1.4.2 +++ conga/luci/site/luci/Extensions/ClusterModel/ClusterNode.py 2008/02/07 06:52:56 1.1.4.3 @@ -6,6 +6,7 @@ # Free Software Foundation. from TagObject import TagObject +from Fence import Fence TAG_NAME = "clusternode" @@ -14,16 +15,21 @@ TagObject.__init__(self) self.TAG_NAME = TAG_NAME + def getFenceNode(self): + ret = None + for child in self.getChildren(): + if child.getTagName() == 'fence': + ret = child + break + if ret is None: + ret = Fence() + self.addChild(ret) + return ret + def getFenceLevels(self): - #under this node will be a 'fence' block, then 0 or more 'method' blocks. - #This method returns the set of 'method' objs. 'method' blocks represent - #fence levels - child = self.getChildren() - if len(child) > 0: - return child[0].getChildren() - else: - retval = list() - return retval + # This method returns the set of 'method' objs. 'method' blocks represent + # fence levels + return self.getFenceNode().getChildren() def getMulticastNode(self): children = self.getChildren() --- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2008/01/23 04:44:33 1.1.4.6 +++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2008/02/07 06:52:56 1.1.4.7 @@ -981,13 +981,6 @@ mcast = self.mcast_ptr mcast.addAttribute('addr', mcast_addr) - if mcast_if is not None: - mcast.addAttribute('interface', mcast_if) - else: - try: - mcast.removeAttribute('interface') - except: - pass self.mcast_address = mcast_addr self.mcast_interface = mcast_if self.usesMulticast = True Binary files /cvs/cluster/conga/luci/site/luci/var/Data.fs 2008/01/25 17:18:38 1.15.2.27 and /cvs/cluster/conga/luci/site/luci/var/Data.fs 2008/02/07 06:52:56 1.15.2.28 differ rcsdiff: /cvs/cluster/conga/luci/site/luci/var/Data.fs: diff failed --- conga/make/version.in 2008/01/29 22:02:12 1.21.2.31 +++ conga/make/version.in 2008/02/07 06:53:23 1.21.2.32 @@ -1,2 +1,2 @@ VERSION=0.12.0 -RELEASE=2 +RELEASE=3