conga/luci cluster/form-macros cluster/index_h ...
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2006-10-31 17:28:04
Modified files:
luci/cluster : form-macros index_html resource-form-macros
resource_form_handlers.js
luci/homebase : form-macros index_html
luci/logs : index_html
luci/site/luci/Extensions: LuciSyslog.py ModelBuilder.py
cluster_adapters.py homebase_adapters.py ricci_bridge.py ricci_communicator.py
Log message:
fixes (or at least improvements) for bz#s: 212021, 212632, 212006, 212022, 212440, 212991, 212584, 213057
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.90.2.1&r2=1.90.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/index_html.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20&r2=1.20.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.21&r2=1.21.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20&r2=1.20.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.44&r2=1.44.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/index_html.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.18&r2=1.18.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/logs/index_html.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/LuciSyslog.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.1&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8.2.1&r2=1.8.2.2
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.7&r2=1.120.2.8
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.2&r2=1.34.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.30.2.4&r2=1.30.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_communicator.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.9.2.1&r2=1.9.2.2
luci/cluster/form-macros +5 -2
@@ -21,10 +21,10 @@ <span tal:define="global nodereports isBusy/nodereports"/> <span tal:repeat="nodereport nodereports"> <tr><td> - <span tal:condition="python: nodereport['isnodecreation'] == False"> + <span tal:condition="python: not 'isnodecreation' in nodereport or nodereport['isnodecreation'] == False"> <h2><span tal:content="nodereport/desc" /></h2> </span> - <span tal:condition="python: nodereport['isnodecreation'] == True"> + <span tal:condition="python: 'isnodecreation' in nodereport and nodereport['isnodecreation'] == True"> <span tal:condition="python: nodereport['iserror'] == True"> <h2><span tal:content="nodereport/desc" /></h2> <font color="red"><span tal:content="nodereport/errormessage"/></font>
@@ -2060,6 +2060,7 @@ set_page_title('Luci ??? cluster ??? services ??? Configure a service'); </script> <tal:block metal:use-macro="here/form-macros/macros/service-config-head-macro" /> + <table class="cluster service" width="100%"> <tr class="cluster service info_top"> <td class="cluster service service_name">
@@ -2070,6 +2071,8 @@ </td> <td class="cluster service service_action"> <form method="post" onSubmit="return dropdown(this.gourl)"> + <input type="hidden" name="pagetype" tal:attributes=" + value request/pagetype | request/form/pagetype | nothing" /> <select name="gourl" tal:define="global innermap sinfo/innermap; starturls innermap/links">
luci/cluster/index_html +10 -12
@@ -212,24 +212,16 @@ <metal:main-form-content use-macro="here/form-chooser/macros/main-form"> - <h1>Future Site of Forms</h1> </metal:main-form-content> - </div> - - </div> - - </metal:block> - - <span tal:omit-tag="" - tal:define="global ret python: request.SESSION.get('checkRet')" - /> + <tal:block tal:condition="python: request.SESSION.has_key('checkRet')" + tal:define="ret python: request.SESSION.get('checkRet')"> <div class="retmsgs" id="retmsgsdiv" tal:condition="python:(ret and 'messages' in ret and len(ret['messages']))"> <div class="hbclosebox"> <a href="javascript:hide_element('retmsgsdiv');"><img src="../homebase/x.png"></a> </div> <ul class="retmsgs"> - <tal:block repeat="e python:ret['messages']"> + <tal:block tal:repeat="e python:ret['messages']"> <li class="retmsgs" tal:content="python:e" /> </tal:block> </ul>
@@ -241,11 +233,17 @@ </div> <p class="errmsgs">The following errors occurred:</p> <ul class="errmsgs"> - <tal:block repeat="e python:ret['errors']"> + <tal:block tal:repeat="e python:ret['errors']"> <li class="errmsgs" tal:content="python:e" /> </tal:block> </ul> </div> + </tal:block> + </div> + + </div> + + </metal:block> </td> <tal:comment replace="nothing"> End of main content block </tal:comment>
luci/cluster/resource-form-macros +2 -3
@@ -199,9 +199,8 @@ src="/luci/cluster/resource_form_handlers.js"> </script> - <tal:block - tal:define=" - global res python: here.getResourceInfo(modelb, request);" /> + <tal:block tal:define=" + global res python: here.getResourceInfo(modelb, request);" /> <h2>Add a Resource</h2>
luci/cluster/resource_form_handlers.js +1 -1
@@ -140,7 +140,7 @@ function validate_filesystem(form) { var errors = new Array(); - if (!form.fsTypeSelect || str_is_blank(form.fsTypeSelect.value)) { + if (!form.fstype || str_is_blank(form.fstype.value)) { errors.push('No file system type was given.'); set_form_err(form.fsTypeSelect); } else
luci/homebase/form-macros +6 -3
@@ -1,7 +1,7 @@ <html> <tal:comment tal:replace="nothing"> - $Id: form-macros,v 1.44 2006/10/16 20:46:46 rmccabe Exp $ + $Id: form-macros,v 1.44.2.1 2006/10/31 17:28:04 rmccabe Exp $ </tal:comment> <head>
@@ -554,8 +554,11 @@ set_page_title('Luci ??? homebase ??? Add a running cluster to be managed by Luci'); </script> - <tal:block tal:define=" - global sessionObj python:request.SESSION.get('checkRet')" /> + <tal:block tal:condition="python: request.SESSION.has_key('checkRet')" + tal:define="global sessionObj python:request.SESSION.get('checkRet')" /> + + <tal:block tal:condition="python: not request.SESSION.has_key('checkRet')" + tal:define="global sessionObj python:{}" /> <h2 class="homebase">Add Cluster</h2>
luci/homebase/index_html +6 -6
@@ -15,7 +15,7 @@ xml:lang language"> <tal:comment replace="nothing"> - $Id: index_html,v 1.18 2006/10/09 16:16:11 rmccabe Exp $ + $Id: index_html,v 1.18.2.1 2006/10/31 17:28:04 rmccabe Exp $ </tal:comment> <head metal:use-macro="here/header/macros/html_header">
@@ -133,16 +133,15 @@ Homebase </metal:main_form> - <span tal:omit-tag="" - tal:define="global ret python: request.SESSION.get('checkRet')" - /> + <tal:block tal:condition="python: request.SESSION.has_key('checkRet')" + tal:define="ret python: request.SESSION.get('checkRet')"> <div class="retmsgs" id="retmsgsdiv" tal:condition="python:(ret and 'messages' in ret and len(ret['messages']))"> <div class="hbclosebox"> <a href="javascript:hide_element('retmsgsdiv');"><img src="x.png"></a> </div> <ul class="retmsgs"> - <tal:block repeat="e python:ret['messages']"> + <tal:block tal:repeat="e python:ret['messages']"> <li class="retmsgs" tal:content="python:e" /> </tal:block> </ul>
@@ -154,11 +153,12 @@ </div> <p class="errmsgs">The following errors occurred:</p> <ul class="errmsgs"> - <tal:block repeat="e python:ret['errors']"> + <tal:block tal:repeat="e python:ret['errors']"> <li class="errmsgs" tal:content="python:e" /> </tal:block> </ul> </div> + </tal:block> </div>
luci/logs/index_html +72 -19
106 lines not on this page · raw message
luci/site/luci/Extensions/LuciSyslog.py +2 -2
@@ -50,7 +50,7 @@ try: syslog(LOG_DEBUG, msg) except: - raise LuciSyslogError, 'syslog debug calle failed' + raise LuciSyslogError, 'syslog debug call failed' def debug(self, msg): if not LUCI_DEBUG_MODE or not self.__init:
@@ -58,7 +58,7 @@ try: syslog(LOG_DEBUG, msg) except: - raise LuciSyslogError, 'syslog debug calle failed' + raise LuciSyslogError, 'syslog debug call failed' def close(self): try:
luci/site/luci/Extensions/ModelBuilder.py +3 -3
@@ -416,9 +416,9 @@ return True - def exportModelAsString(self, strbuf): + def exportModelAsString(self): if self.perform_final_check() == False: # failed - return False + return None #check for dual power fences self.dual_power_fence_check()
@@ -438,7 +438,7 @@ #can be used self.purgePCDuplicates() - return True + return strbuf def has_filepath(self): if self.filename == None:
luci/site/luci/Extensions/cluster_adapters.py +744 -373
1,766 lines not on this page · raw message
luci/site/luci/Extensions/homebase_adapters.py +7 -13
@@ -14,9 +14,6 @@ from clusterOS import resolveOSType from conga_constants import * -class InCluster(Exception): - pass - def siteIsSetup(self): try: if os.path.isfile(CERTS_DIR_PATH + 'privkey.pem') and os.path.isfile(CERTS_DIR_PATH + 'cacert.pem'):
@@ -661,23 +658,20 @@ except: sessionData = None + try: + request.SESSION.delete('checkRet') + except: + pass + if 'ACTUAL_URL' in request: url = request['ACTUAL_URL'] else: url = '.' - if 'pagetype' in request.form: - pagetype = int(request.form['pagetype']) - else: - try: request.SESSION.set('checkRet', {}) - except: pass - return homebasePortal(self, request, '.', '0') - try: + pagetype = int(request.form['pagetype']) validatorFn = formValidators[pagetype - 1] except: - try: request.SESSION.set('checkRet', {}) - except: pass return homebasePortal(self, request, '.', '0') if validatorFn == validateAddClusterInitial or validatorFn == validateAddCluster:
@@ -705,7 +699,7 @@ return homebaseControlPost(self, request) try: - request.SESSION.set('checkRet', {}) + request.SESSION.delete('checkRet') except: pass
luci/site/luci/Extensions/ricci_bridge.py +53 -47
171 lines not on this page · raw message
luci/site/luci/Extensions/ricci_communicator.py +7 -5
@@ -216,10 +216,12 @@ luci_log.debug('An error occurred while trying to process the batch job: %s' % batch_xml_str) return None - return ricci_xml + doc = minidom.Document() + doc.appendChild(ricci_xml) + return doc def batch_report(self, batch_id): - luci_log.debug_verbose('[auth=%d] asking for batchid# %d for host %s' \ + luci_log.debug_verbose('[auth=%d] asking for batchid# %s for host %s' \ % (self.__authed, batch_id, self.__hostname)) if not self.authed():
@@ -242,7 +244,7 @@ if doc.firstChild.getAttribute('success') == '12': return None if doc.firstChild.getAttribute('success') != '0': - raise RicciError, 'Error while retrieving batch report for batch #%s from host %s' % (batch_id, self.__hostname) + raise RicciError, 'Error while retrieving batch report for batch #%d from host %s' % (batch_id, self.__hostname) batch_node = None for node in doc.firstChild.childNodes: if node.nodeType == xml.dom.Node.ELEMENT_NODE:
@@ -401,10 +403,10 @@ last = last + 1 last = last - 2 * last try: - luci_log.debug_verbose('Returning (%s, %s) for batch_status(\"%s\")' \ + luci_log.debug_verbose('Returning (%d, %d) for batch_status(\"%s\")' \ % (last, total, batch_xml.toxml())) except: - pass + luci_log.debug_verbose('Returning last, total') return (last, total)