conga/luci/site/luci/Extensions cluster_adapte ...
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-11-02 20:41:29
Modified files:
luci/site/luci/Extensions: cluster_adapters.py
Log message:
fix for viewing cluster nodes without fqdn
luci/site/luci/Extensions/cluster_adapters.py +26 -12
@@ -264,7 +264,7 @@ requestResults = {} try: - sessionData = request.SESSION.get('checkRet') + sessionData = request.SESSION.get('checkRet') except: sessionData = None
@@ -2555,14 +2555,28 @@ infohash['d_states'] = None if nodestate == NODE_ACTIVE or nodestate == NODE_INACTIVE: #call service module on node and find out which daemons are running - rc = RicciCommunicator(nodename) - dlist = list() - dlist.append("ccsd") - dlist.append("cman") - dlist.append("fenced") - dlist.append("rgmanager") - states = getDaemonStates(rc, dlist) - infohash['d_states'] = states + try: + nodename_resolved = resolve_nodename(self, clustername, nodename) + except: + luci_log.debug_verbose('Unable to resolve node name %s/%s to retrieve daemon information' % (nodename, clustername)) + nodename_resolved = nodename + try: + rc = RicciCommunicator(nodename_resolved) + if not rc: + raise Exception, 'rc is none' + except Exception, e: + rc = None + luci_log.info('Error connecting to %s: %s' \ + % (nodename_resolved, str(e))) + + if rc is not None: + dlist = list() + dlist.append("ccsd") + dlist.append("cman") + dlist.append("fenced") + dlist.append("rgmanager") + states = getDaemonStates(rc, dlist) + infohash['d_states'] = states infohash['logurl'] = '/luci/logs/?nodename=' + nodename + '&clustername=' + clustername return infohash
@@ -2716,7 +2730,7 @@ name = kid.getName() found_fd = False if not i in map: - continue + continue for entry in map[i]: if entry['name'] == name: fence_struct = entry
@@ -2838,7 +2852,7 @@ try: stringbuf = model.exportModelAsString() if not stringbuf: - raise Exception, 'model is blank' + raise Exception, 'model is blank' except Exception, e: luci_log.debug_verbose('exportModelAsString error: %s' % str(e)) return None
@@ -2871,7 +2885,7 @@ luci_log.debug_verbose('servicename is missing from request') return {} - try: + try: xenvm = model.retrieveXenVMsByName(xenvmname) except: luci_log.debug('An error occurred while attempting to get VM %s' \