From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 12 Dec 2007 15:48:32 -0000 Subject: [Cluster-devel] conga/luci/site/luci/Extensions LuciZope.py He ... Message-ID: <20071212154832.5041.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 Changes by: rmccabe at sourceware.org 2007-12-12 15:48:30 Modified files: luci/site/luci/Extensions: LuciZope.py HelperFunctions.py LuciZopeAsync.py LuciZopeExternal.py Log message: More shuffling stuff around to use the new form validation Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZope.py.diff?cvsroot=cluster&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/HelperFunctions.py.diff?cvsroot=cluster&r1=1.10&r2=1.11 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeAsync.py.diff?cvsroot=cluster&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeExternal.py.diff?cvsroot=cluster&r1=1.3&r2=1.4 --- conga/luci/site/luci/Extensions/LuciZope.py 2007/08/20 16:31:13 1.5 +++ conga/luci/site/luci/Extensions/LuciZope.py 2007/12/12 15:48:29 1.6 @@ -145,3 +145,22 @@ pval = None ret[i] = pval return ret + +def getClusterURL(self, request, model): + try: + clustername = request['clustername'].strip() + if not clustername: + raise Exception, 'cluster name from request is blank' + except: + try: + clustername = model.getClusterName() + if not clustername: + raise Exception, 'cluster name from model is blank' + except: + if LUCI_DEBUG_MODE is True: + luci_log.debug_verbose('GCURL0: unable to get cluster name') + return '' + + return '/luci/cluster/index_html?pagetype=7&clustername=%s' % clustername + + --- conga/luci/site/luci/Extensions/HelperFunctions.py 2007/09/24 21:19:42 1.10 +++ conga/luci/site/luci/Extensions/HelperFunctions.py 2007/12/12 15:48:29 1.11 @@ -53,7 +53,8 @@ args.insert(0, rc) r['batch_result'] = self.query_func(*args) except Exception, e: - pass + r['error'] = True + r['err_msg'] = '%s' % str(e) self.mutex.acquire() self.riccis[host] = r --- conga/luci/site/luci/Extensions/LuciZopeAsync.py 2007/09/25 04:00:24 1.3 +++ conga/luci/site/luci/Extensions/LuciZopeAsync.py 2007/12/12 15:48:30 1.4 @@ -178,5 +178,11 @@ % (request['nodenames'], e, str(e))) write_err_async(request, 'Error retrieving information') return None - xml_obj = result_to_xml(True, { 'result': ret }) + xml_obj = result_to_xml((True, { 'result': ret })) + write_xml_resp(request, xml_obj) + +def validate_clusvc_async(self, request): + from LuciValidation import validate_clusvc_add + ret = validate_clusvc_add(self, request) + xml_obj = result_to_xml((True, { 'result': ret })) write_xml_resp(request, xml_obj) --- conga/luci/site/luci/Extensions/LuciZopeExternal.py 2007/08/08 21:00:07 1.3 +++ conga/luci/site/luci/Extensions/LuciZopeExternal.py 2007/12/12 15:48:30 1.4 @@ -14,11 +14,10 @@ getDefaultUser from cluster_adapters import clusterTaskProcess, \ - resourceAdd, resourceDelete, serviceDelete, \ - getClusterURL, getSystemLogs, getRicciAgentForCluster, \ + resourceDelete, serviceDelete, \ isClusterBusy, nodeTaskProcess, process_cluster_conf_editor, \ serviceMigrate, serviceRestart, serviceStart, serviceStop, \ - getResourceInfo + getResourceInfo, getSystemLogs from HelperFunctions import add_commas, bytes_to_value_units, convert_bytes @@ -28,12 +27,15 @@ getNodeInfo, getnodes, getNodesInfo, getResourcesInfo, \ getServiceInfo, getServicesInfo, getVMInfo, getClusterOS +from LuciClusterActions import getRicciAgentForCluster + from LuciDB import access_to_host_allowed, allowed_systems, \ check_clusters, getRicciAgent, getSystems, getClusters, \ getStorage from LuciZope import appendModel, bytes_to_value_prefunits, \ - set_persistent_var, strFilter, getTabs, siteIsSetup + set_persistent_var, strFilter, getTabs, siteIsSetup, \ + getClusterURL from LuciZopeClusterPortal import createCluChooser, createCluConfigTree @@ -52,4 +54,4 @@ from system_adapters import get_sys_svc_list, validate_manage_svc -from LuciZopeAsync import get_cluster_nodes_async, get_sysinfo_async +from LuciZopeAsync import get_cluster_nodes_async, get_sysinfo_async, validate_clusvc_async