conga ./conga.spec.in.in luci/cluster/resource ...
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.spec.in.in +3 -0
@@ -292,6 +292,9 @@ ### changelog ### %changelog +* Wed Feb 06 2008 Ryan McCabe <[email protected]> 0.12.0-3 +- Fix bz431105 (IP Address Resource configuration: cannot enter fully qualified hostname) + * Mon Jan 28 2008 Ryan McCabe <[email protected]> 0.12.0-2 - Fix bz430737 (Conga should install the 'cmirror' package when clustered storage is requested)
luci/cluster/resource_form_handlers.js +3 -2
@@ -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); }
luci/cluster/validate_config_multicast.js +2 -2
@@ -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);
luci/homebase/form-macros +3 -3
@@ -219,7 +219,7 @@ tal:define="cfname python: here.strFilter('[^0-9A-Za-z_-]', '_', c)" tal:attributes="id python: cfname"> - <input type="checkbox" class="homebase" + <input type="checkbox" class="blank" tal:define="global num_clusters python:num_clusters + 1" tal:attributes=" checked python:perms[curUser]['cluster'][c] and 'checked' or None;
@@ -235,7 +235,7 @@ <h3 class="homebase">Storage Systems</h3> <div class="hbcheckdiv" tal:repeat="s python: systems[1]"> - <input type="checkbox" class="homebase" + <input type="checkbox" class="blank" tal:define="global num_systems python:num_systems + 1" tal:attributes=" checked python:perms[curUser]['storage'][s] and 'checked' or None;
@@ -243,7 +243,7 @@ id python:'__SYSTEM' + str(num_systems); value python:s" /> - <span class="hbText" tal:omit-tag="" tal:content="python:s"/> + <span class="hbText" tal:content="python:s"/> </div> </tal:block>
luci/homebase/validate_cluster_add_initial.js +6 -4
@@ -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); } }
luci/homebase/validate_user_add.js +2 -2
@@ -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); }
luci/init.d/luci +98 -31
252 lines not on this page · raw message
luci/plone-custom/conga.js +19 -11
@@ -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.'); }
luci/plone-custom/footer +1 -7
@@ -10,13 +10,7 @@ Conga Cluster and Storage Management System</a> </span> is Copyright - <acronym title="Copyright" i18n:name="copyright" i18n:attributes="title title_copyright;"> - © - </acronym> - 2000—<span - i18n:name="current_year" - tal:define="now modules/DateTime/DateTime" - tal:content="now/year" /> + <acronym title="Copyright" i18n:name="copyright" i18n:attributes="title title_copyright;">©</acronym> 2000–2008 <a href="http://www.redhat.com/">Red Hat, Inc.</a> </span> </p>
luci/plone-custom/luci.css +4 -0
@@ -32,6 +32,10 @@ margin-right: +.3333em; } +input.blank { + margin: 0px .3333em 0px .3333em ! important; +} + td.pad_right { padding-right: +.6666em; }
luci/site/luci/Extensions/LuciDB.py +16 -15
@@ -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:
luci/site/luci/Extensions/LuciValidation.py +13 -19
@@ -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 <fence> 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 <fence> 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 })
luci/site/luci/Extensions/LuciZopeAsync.py +18 -2
@@ -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' \
luci/site/luci/Extensions/homebase_adapters.py +3 -0
@@ -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' ]})
luci/site/luci/Extensions/ClusterModel/ClusterNode.py +15 -9
@@ -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()
luci/site/luci/Extensions/ClusterModel/ModelBuilder.py +0 -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
make/version.in +1 -1
@@ -1,2 +1,2 @@ VERSION=0.12.0 -RELEASE=2 +RELEASE=3