conga/luci/site/luci/Extensions FenceHandler.p ...
CVSROOT: /cvs/cluster
Module name: conga
Branch: EXPERIMENTAL
Changes by: rmccabe at sourceware.org 2007-05-15 21:42:21
Modified files:
luci/site/luci/Extensions: FenceHandler.py HelperFunctions.py
LuciClusterActions.py LuciClusterInfo.py LuciDB.py LuciSyslog.py LuciZope.py PropsObject.py ResourceHandler.py RicciQueries.py StorageReport.py Variable.py cluster_adapters.py conga_constants.py conga_ssl.py conga_storage_constants.py homebase_adapters.py ricci_communicator.py ricci_defines.py storage_adapters.py system_adapters.py
luci/site/luci/Extensions/ClusterModel: BaseResource.py
Cluster.py ClusterNode.py FailoverDomainNode.py FailoverDomains.py FenceDevice.py ModelBuilder.py TagObject.py
Added files:
luci/site/luci/Extensions: LuciZopePerm.py
Log message:
More cleanup and refactor.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopePerm.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/FenceHandler.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.18.2.1&r2=1.18.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/HelperFunctions.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.6.4.2&r2=1.6.4.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterActions.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciDB.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.5&r2=1.1.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciSyslog.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.11.4.1&r2=1.11.4.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZope.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.3&r2=1.1.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/PropsObject.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.2.8.2&r2=1.2.8.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ResourceHandler.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/RicciQueries.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.23.2.2&r2=1.23.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Variable.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.4.8.2&r2=1.4.8.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.255.2.4&r2=1.255.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.39.2.3&r2=1.39.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_ssl.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.2.4.1&r2=1.2.4.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_storage_constants.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.8.8.1&r2=1.8.8.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.50.2.3&r2=1.50.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_communicator.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.25.2.3&r2=1.25.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_defines.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.8.1&r2=1.1.8.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/storage_adapters.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.9.4.2&r2=1.9.4.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/system_adapters.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.2.2.2&r2=1.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/BaseResource.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/Cluster.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ClusterNode.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/FailoverDomainNode.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/FailoverDomains.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/FenceDevice.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.3&r2=1.1.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/TagObject.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.2&r2=1.1.2.3
luci/site/luci/Extensions/FenceHandler.py +7 -0
@@ -1,3 +1,10 @@ +# Copyright (C) 2006-2007 Red Hat, Inc. +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of version 2 of the +# GNU General Public License as published by the +# Free Software Foundation. + from ClusterModel.Device import Device FD_VAL_FAIL = 1
luci/site/luci/Extensions/HelperFunctions.py +11 -4
@@ -1,3 +1,10 @@ +# Copyright (C) 2006-2007 Red Hat, Inc. +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of version 2 of the +# GNU General Public License as published by the +# Free Software Foundation. + from ricci_communicator import RicciCommunicator import threading
@@ -67,7 +74,7 @@ trusted = False ricci = ss[hostname] - if ricci != None: + if ricci is not None: OS = ricci.os() cluname = ricci.cluster_info()[0] cluali = ricci.cluster_info()[1]
@@ -81,9 +88,9 @@ 'hostname' : hostname, 'OS' : OS, 'cluname' : cluname, - 'key_fp' : key_fp, - 'clualias' : cluali, - 'available' : ricci != None, + 'key_fp' : key_fp, + 'clualias' : cluali, + 'available' : ricci is not None, 'trusted' : trusted, 'authed' : authed }
luci/site/luci/Extensions/Attic/LuciClusterActions.py +7 -0
@@ -1,3 +1,10 @@ +# Copyright (C) 2006-2007 Red Hat, Inc. +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of version 2 of the +# GNU General Public License as published by the +# Free Software Foundation. + import RicciQueries as rq from LuciDB import set_node_flag, getRicciAgent from LuciSyslog import get_logger
luci/site/luci/Extensions/Attic/LuciClusterInfo.py +38 -21
190 lines not on this page · raw message
luci/site/luci/Extensions/Attic/LuciDB.py +13 -34
95 lines not on this page · raw message
luci/site/luci/Extensions/LuciSyslog.py +9 -1
@@ -1,8 +1,16 @@ -from conga_constants import LUCI_DEBUG_MODE, LUCI_DEBUG_VERBOSITY +# Copyright (C) 2006-2007 Red Hat, Inc. +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of version 2 of the +# GNU General Public License as published by the +# Free Software Foundation. + from syslog import openlog, closelog, syslog, \ LOG_DAEMON, LOG_PID, LOG_NDELAY, LOG_INFO, \ LOG_WARNING, LOG_AUTH, LOG_DEBUG +from conga_constants import LUCI_DEBUG_MODE, LUCI_DEBUG_VERBOSITY + # Exception class for the LuciSyslog facility class LuciSyslogError(Exception): def __init__(self, msg):
luci/site/luci/Extensions/Attic/LuciZope.py +13 -28
71 lines not on this page · raw message
luci/site/luci/Extensions/PropsObject.py +14 -8
@@ -1,14 +1,20 @@ +# Copyright (C) 2006-2007 Red Hat, Inc. +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of version 2 of the +# GNU General Public License as published by the +# Free Software Foundation. + from Variable import parse_variable from ricci_defines import PROPS_TAG import xml import xml.dom - class PropsObject: - + def __init__(self): self.__vars = {} - + def add_prop(self, variable): self.__vars[variable.get_name()] = variable def get_prop(self, name):
@@ -16,24 +22,24 @@ return self.__vars[name].get_value() else: return None - + def get_props(self): return self.__vars - + def export_xml(self, doc, parent_node): props = doc.createElement(str(PROPS_TAG)) parent_node.appendChild(props) for var in self.__vars: props.appendChild(self.__vars[var].export_xml(doc)) return props - + def import_xml(self, parent_node): props = None for node in parent_node.childNodes: if node.nodeType == xml.dom.Node.ELEMENT_NODE: if node.nodeName == str(PROPS_TAG): props = node - if props == None: + if props is None: return self for node in props.childNodes: try:
@@ -42,4 +48,4 @@ except: continue return self - +
luci/site/luci/Extensions/Attic/ResourceHandler.py +8 -1
@@ -1,3 +1,10 @@ +# Copyright (C) 2006-2007 Red Hat, Inc. +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of version 2 of the +# GNU General Public License as published by the +# Free Software Foundation. + from ClusterModel.Ip import Ip from ClusterModel.Fs import Fs from ClusterModel.Clusterfs import Clusterfs
@@ -687,7 +694,7 @@ if form.has_key('edit'): if not form.has_key('oldname'): raise Exception, [ 'Cannot find this resource\'s original name.' ] - + oldname = form['oldname'].strip() if not oldname: raise Exception, [ 'Cannot find this resource\'s original name.' ]
luci/site/luci/Extensions/Attic/RicciQueries.py +24 -17
143 lines not on this page · raw message
luci/site/luci/Extensions/StorageReport.py +267 -258
1,363 lines not on this page · raw message
luci/site/luci/Extensions/Variable.py +37 -26
169 lines not on this page · raw message
luci/site/luci/Extensions/cluster_adapters.py +28 -22
162 lines not on this page · raw message
luci/site/luci/Extensions/conga_constants.py +8 -1
@@ -1,3 +1,10 @@ +# Copyright (C) 2006-2007 Red Hat, Inc. +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of version 2 of the +# GNU General Public License as published by the +# Free Software Foundation. + # Cluster area page types CLUSTERLIST = '3' CLUSTERS = '4'
@@ -131,7 +138,7 @@ PRE_CFG = 'Reboot stage successful, but configuration for the cluster is not yet distributed.' PRE_JOIN = 'Packages are installed and configuration has been distributed, but the node has not yet joined the cluster.' -POSSIBLE_REBOOT_MESSAGE = 'This node is not currently responding and is probably rebooting as planned. This state should persist for 5 minutes or so...' +POSSIBLE_REBOOT_MESSAGE = 'This node is not currently responding and is probably rebooting as planned. This state could persist for 5 minutes or so...' REDIRECT_MSG = ' -- You will be redirected in 5 seconds.'
luci/site/luci/Extensions/conga_ssl.py +11 -4
@@ -1,3 +1,10 @@ +# Copyright (C) 2006-2007 Red Hat, Inc. +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of version 2 of the +# GNU General Public License as published by the +# Free Software Foundation. + import sys sys.path.append('/usr/lib/luci/ssl') sys.path.append('/usr/lib64/luci/ssl')
@@ -9,7 +16,7 @@ # timeouts are in seconds (int) class SSLSocket: - + def __init__(self, hostname, port,
@@ -25,10 +32,10 @@ if self.__id != -1: conga_ssl_lib.disconnect(self.__id) self.__id = -1 - + def peer_fingerprint(self): return conga_ssl_lib.peer_fingerprint(self.__id) - + def trusted(self): return conga_ssl_lib.trusted(self.__id) == 1 def trust(self):
@@ -37,7 +44,7 @@ return conga_ssl_lib.trust(self.__id, self.__hostname) == 1 def untrust(self): return conga_ssl_lib.untrust(self.__id) == 1 - + def send(self, msg, timeout): conga_ssl_lib.send(self.__id, msg, timeout) def recv(self, timeout):
luci/site/luci/Extensions/conga_storage_constants.py +16 -7
@@ -1,4 +1,13 @@ -from ricci_defines import MAPPER_ATARAID_TYPE, MAPPER_CRYPTO_TYPE, MAPPER_iSCSI_TYPE, MAPPER_MDRAID_TYPE, MAPPER_MULTIPATH_TYPE, MAPPER_PT_TYPE, MAPPER_SYS_TYPE, MAPPER_VG_TYPE +# Copyright (C) 2006-2007 Red Hat, Inc. +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of version 2 of the +# GNU General Public License as published by the +# Free Software Foundation. + +from ricci_defines import MAPPER_ATARAID_TYPE, MAPPER_CRYPTO_TYPE, \ + MAPPER_iSCSI_TYPE, MAPPER_MDRAID_TYPE, MAPPER_MULTIPATH_TYPE, \ + MAPPER_PT_TYPE, MAPPER_SYS_TYPE, MAPPER_VG_TYPE ## request vars ##
@@ -66,12 +75,12 @@ 'extents_used' : "Used Extents", 'failed' : "Failed", 'format' : "Format", - 'fstab' : "List in /etc/fstab", - 'fstabpoint' : "/etc/fstab Mountpoint", - 'gfs_fsname' : "Unique GFS Name", + 'fstab' : "List in /etc/fstab", + 'fstabpoint' : "/etc/fstab Mountpoint", + 'gfs_fsname' : "Unique GFS Name", 'has_journal' : "Journaling Enabled - ext3", - 'journals_num' : "Number Of Journals", - 'journal_size' : "Journal Size", + 'journals_num' : "Number Of Journals", + 'journal_size' : "Journal Size", 'label' : "Label", 'level' : "Level", 'locking_protocol' : "Locking Protocol",
@@ -84,7 +93,7 @@ 'model' : "Model", 'mount' : "Mount", 'mountable' : "Mountable", - 'mountpoint' : "Mountpoint", + 'mountpoint' : "Mountpoint", 'num_devices' : "Number of Devices", 'num_spares' : "Number of Spares", 'partition_begin' : "Partition Begin",
luci/site/luci/Extensions/homebase_adapters.py +122 -71
482 lines not on this page · raw message
luci/site/luci/Extensions/ricci_communicator.py +54 -47
89 lines not on this page · raw message
luci/site/luci/Extensions/ricci_defines.py +7 -0
Lines of this file are not shown. View the raw message.
luci/site/luci/Extensions/storage_adapters.py +60 -67
127 lines not on this page · raw message
luci/site/luci/Extensions/system_adapters.py +16 -3
Lines of this file are not shown. View the raw message.
luci/site/luci/Extensions/ClusterModel/Attic/BaseResource.py +0 -1
Lines of this file are not shown. View the raw message.
luci/site/luci/Extensions/ClusterModel/Attic/Cluster.py +5 -5
Lines of this file are not shown. View the raw message.
luci/site/luci/Extensions/ClusterModel/Attic/ClusterNode.py +2 -2
Lines of this file are not shown. View the raw message.
luci/site/luci/Extensions/ClusterModel/Attic/FailoverDomainNode.py +3 -3
Lines of this file are not shown. View the raw message.
luci/site/luci/Extensions/ClusterModel/Attic/FailoverDomains.py +1 -1
Lines of this file are not shown. View the raw message.
luci/site/luci/Extensions/ClusterModel/Attic/FenceDevice.py +1 -1
Lines of this file are not shown. View the raw message.
luci/site/luci/Extensions/ClusterModel/Attic/ModelBuilder.py +94 -96
190 lines not on this page · raw message
luci/site/luci/Extensions/ClusterModel/Attic/TagObject.py +4 -4
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.