Skip to contentSkip to conversation

conga ./clustermon.spec.in.in ./conga.spec.in. ...

Cluster-devel [email protected] 1 participant 1 message Jul 29, 2008

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2008-07-29 19:47:07

Modified files:
. : clustermon.spec.in.in conga.spec.in.in
luci/cluster : cluster_config-macros cluster_svc-macros
fence-macros validate_config_qdisk.js
luci/plone-custom: conga.js luci/site/luci/Extensions: HelperFunctions.py LuciValidation.py
LuciZopeClusterPortal.py StorageReport.py cluster_adapters.py conga_constants.py
luci/storage : form-macros
ricci/modules/cluster/clumon: REDHAT-CLUSTER-MIB ricci/modules/rpm: PackageHandler.cpp ricci/modules/service: ServiceManager.cpp ricci/modules/storage: LVM.cpp
ricci/modules/virt: Makefile Virt.cpp
ricci/ricci : DBusController.cpp
ricci/ricci/d-bus: ricci.oddjob.conf ricci/test_suite/cluster: vm_list.xml

Log message:
Forward port fixes from RHEL5

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&r1=1.45&r2=1.46
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&r1=1.99&r2=1.100
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_config-macros.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_svc-macros.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence-macros.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_config_qdisk.js.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/conga.js.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/HelperFunctions.py.diff?cvsroot=cluster&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciValidation.py.diff?cvsroot=cluster&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeClusterPortal.py.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.283&r2=1.284
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&r1=1.50&r2=1.51
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/form-macros.diff?cvsroot=cluster&r1=1.31&r2=1.32
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/REDHAT-CLUSTER-MIB.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/rpm/PackageHandler.cpp.diff?cvsroot=cluster&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/service/ServiceManager.cpp.diff?cvsroot=cluster&r1=1.20&r2=1.21
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVM.cpp.diff?cvsroot=cluster&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/virt/Makefile.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/virt/Virt.cpp.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/DBusController.cpp.diff?cvsroot=cluster&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/d-bus/ricci.oddjob.conf.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cluster/vm_list.xml.diff?cvsroot=cluster&r1=1.1&r2=1.2

clustermon.spec.in.in +2 -2
@@ -27,7 +27,7 @@
 Source0: %{name}-%{version}.tar.gz
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires: cman-devel libvirt-devel
+BuildRequires: cman-devel
 BuildRequires: glibc-devel gcc-c++ libxml2-devel
 BuildRequires: openssl-devel dbus-devel pam-devel pkgconfig
 BuildRequires: net-snmp-devel tog-pegasus-devel
@@ -45,6 +45,7 @@
 		--docdir=%{_docdir} \
 		--pegasus_providers_dir=%{PEGASUS_PROVIDERS_DIR} \
 		--include_zope_and_plone=no
+
 make %{?_smp_mflags} clustermon
 
 %install
@@ -56,7 +57,6 @@
 
 
 
-
 ### cluster module ###
 
 
conga.spec.in.in +28 -9
@@ -31,9 +31,14 @@
 %endif
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+%define virt_support 0
+
+%ifarch i386 x86_64 ia64
+%define virt_support 1
+%endif
+
 BuildRequires: python-devel >= 2.4.1
 BuildRequires: glibc-devel gcc-c++ libxml2-devel sed
-BuildRequires: cman-devel
 BuildRequires: cyrus-sasl-devel >= 2.1
 BuildRequires: openssl-devel dbus-devel pkgconfig file
 
@@ -57,9 +62,16 @@
 %endif
 
 %build
+%if %{virt_support}
 %configure		--arch=%{_arch} \
 		--docdir=%{_docdir} \
-		--include_zope_and_plone=%{include_zope_and_plone}
+		--include_zope_and_plone=%{include_zope_and_plone} --VIRT_SUPPORT=1
+%else
+%configure		--arch=%{_arch} \
+		--docdir=%{_docdir} \
+		--include_zope_and_plone=%{include_zope_and_plone} --VIRT_SUPPORT=0
+%endif
+
 make %{?_smp_mflags} conga
 
 %install
@@ -199,10 +211,16 @@
 Requires: initscripts
 Requires: oddjob dbus openssl pam cyrus-sasl >= 2.1
 Requires: sed util-linux
-Requires: modcluster >= 0.10.0
+Requires: modcluster >= 0.12.0
 
 # modreboot
 
+# modvirt
+
+%if %{virt_support}
+BuildRequires: libvirt-devel
+%endif
+
 # modrpm
 
 # modstorage
@@ -254,13 +272,14 @@
 %config(noreplace)	%{_sysconfdir}/dbus-1/system.d/ricci-modlog.systembus.conf
 			%{_libexecdir}/ricci-modlog
 
+# modvirt
+%config(noreplace)	%{_sysconfdir}/oddjobd.conf.d/ricci-modvirt.oddjob.conf
+%config(noreplace)	%{_sysconfdir}/dbus-1/system.d/ricci-modvirt.systembus.conf
+			%{_libexecdir}/ricci-modvirt
+
 %pre -n ricci
-if ! /bin/grep ^ricci\:x /etc/group >&/dev/null; then
-	/usr/sbin/groupadd -r -f ricci >&/dev/null
-fi
-if ! /bin/grep ^ricci\:x /etc/passwd >&/dev/null; then
-	/usr/sbin/useradd -r -M -s /sbin/nologin -d /var/lib/ricci -g ricci ricci >&/dev/null
-fi
+getent group ricci >/dev/null || groupadd -r ricci
+getent passwd ricci >/dev/null || useradd -r -M -g ricci -d /var/lib/ricci -s /sbin/nologin -c "ricci daemon user" ricci
 exit 0
 
 %post -n ricci
luci/cluster/cluster_config-macros +33 -15

54 lines not on this page · raw message

luci/cluster/cluster_svc-macros +87 -176

354 lines not on this page · raw message

luci/cluster/fence-macros +7 -0
@@ -684,6 +684,13 @@
 				</td>
 			</tr>
 			<tr>
+				<td>Module Name</td>
+				<td>
+					<input name="modulename" type="text"
+						tal:attributes="value cur_fencedev/modulename | nothing" />
+				</td>
+			</tr>
+			<tr>
 				<td>
 					<span title="Full path to a script to generate fence password">Password Script (optional)</span>
 				</td>
luci/cluster/validate_config_qdisk.js +3 -0
@@ -206,6 +206,9 @@
 		var no_label = !form.label || str_is_blank(form.label.value);
 		if (no_dev && no_label)
 			errors.push('You must give either a label or a device.');
+		if (!no_dev && !no_label) {
+			errors.push('You may not specify both a device and a label.');
+		}
 
 		var hnum = document.getElementById('num_heuristics');
 		if (hnum) {
luci/plone-custom/conga.js +6 -0
@@ -248,6 +248,12 @@
 	elem.parentNode.removeChild(elem);
 }
 
+function disable_text_field(enable_obj, disable_obj) {
+	disable_obj.value = "";
+	disable_obj.disabled = "disabled";
+	enable_obj.disabled = "";
+}
+
 function swap_tabs(new_label, cur_tab, new_tab) {
 	if (cur_tab == new_tab) {
 		return (cur_tab);
luci/site/luci/Extensions/HelperFunctions.py +1 -1
@@ -9,7 +9,7 @@
 import threading
 
 def resolveOSType(os_str):
-	if not os_str or os_str.find('Tikanga') != (-1) or os_str.find('Zod') != (-1) or os_str.find('Moonshine') != (-1) or os_str.find('Werewolf') != (-1) or os.str_find('Sulphur') != (-1):
+	if not os_str or os_str.find('Tikanga') != (-1) or os_str.find('Zod') != (-1) or os_str.find('Moonshine') != (-1) or os_str.find('Werewolf') != (-1) or os_str.find('Sulphur') != (-1):
 		return 'rhel5'
 	else:
 		return 'rhel4'
luci/site/luci/Extensions/LuciValidation.py +55 -2

93 lines not on this page · raw message

luci/site/luci/Extensions/LuciZopeClusterPortal.py +3 -3
@@ -251,10 +251,10 @@
 
 	if model.getIsVirtualized() is True:
 		vmadd = {}
-		vmadd['Title'] = 'Add a Virtual Service'
+		vmadd['Title'] = 'Add a Virtual Machine Service'
 		vmadd['cfg_type'] = 'vmadd'
 		vmadd['absolute_url'] = '%s?pagetype=%s&clustername=%s' % (url, VM_ADD, cluname)
-		vmadd['Description'] = 'Add a Virtual Service to this cluster'
+		vmadd['Description'] = 'Add a Virtual Machine Service to this cluster'
 		if pagetype == VM_ADD:
 			vmadd['currentItem'] = True
 		else:
@@ -305,7 +305,7 @@
 		svc['Title'] = name
 		svc['cfg_type'] = 'vm'
 		svc['absolute_url'] = '%s?pagetype=%s&servicename=%s&clustername=%s' % (url, VM_CONFIG, name, cluname)
-		svc['Description'] = 'Configure this Virtual Service'
+		svc['Description'] = 'Configure this Virtual Machine Service'
 		if pagetype == VM_CONFIG:
 			try:
 				xname = request['servicename']
luci/site/luci/Extensions/StorageReport.py +4 -2
@@ -1621,9 +1621,10 @@
 		mutable = var.getAttribute('mutable') == 'true'
 		var_type = var.getAttribute('type')
 		value = var.getAttribute('value')
+		def_value = value
 
 		d_units = ''
-		if name in ('size', 'extent_size', 'block_size', 'size_free', 'partition_begin' ):
+		if name in ('size', 'extent_size', 'block_size', 'journal_size', 'size_free', 'partition_begin' ):
 			d_units = 'bytes'
 		if 'percent' in name:
 			d_units = '%'
@@ -1685,7 +1686,7 @@
 			d_value = str(value)
 
 		hidden = False
-		if var_type == 'hidden' or name in ( 'partition_begin', 'snapshot' ):
+		if var_type == 'hidden' or name in ( 'partition_begin', 'snapshot' ) or name[0:11] == '__snap_size':
 			hidden = True
 
 		if name == 'removable':
@@ -1697,6 +1698,7 @@
 				'name': name,
 				'pretty_name': get_pretty_prop_name(name),
 				'type': d_type,
+				'default_val': def_value,
 				'value': d_value,
 				'units': d_units,
 				'validation': validation_data,
luci/site/luci/Extensions/cluster_adapters.py +3 -2
@@ -545,7 +545,9 @@
 	next_node_id = 1
 
 	try:
-		for x in system_list:
+		skeys = system_list.keys()
+		skeys.sort()
+		for x in skeys:
 			i = system_list[x]
 
 			try:
@@ -1167,7 +1169,6 @@
 				msg_list.append('Fix the error and try again:\n')
 			else:
 				msg_list.append('PASSED\n')
-				model.setModified(True)
 				msg_list.append('DONE\n')
 				msg_list.append('Propagating the new cluster.conf')
 
luci/site/luci/Extensions/conga_constants.py +3 -3
@@ -155,6 +155,6 @@
 # Debugging parameters. Set LUCI_DEBUG_MODE to True and LUCI_DEBUG_VERBOSITY
 # to >= 2 to get full debugging output in syslog (LOG_DAEMON/LOG_DEBUG).
 
-LUCI_DEBUG_MODE			= True
-LUCI_DEBUG_NET			= True
-LUCI_DEBUG_VERBOSITY	= 5
+LUCI_DEBUG_MODE			= False
+LUCI_DEBUG_NET			= False
+LUCI_DEBUG_VERBOSITY	= 0
luci/storage/form-macros +22 -13
@@ -87,6 +87,7 @@
 						</select>
 					</td>
 				</tr>
+				<tal:comment tal:replace="nothing">
 				<tr>
 					<td>
 						Display Devices by
@@ -99,6 +100,7 @@
 						</select>
 					</td>
 				</tr>
+				</tal:comment>
 			</table>
 		</form>
 	</fieldset>
@@ -865,21 +867,28 @@
 
 							<tal:block tal:condition="python:prop_type == 'select'">
 								<select tal:define="prop_options prop/value" tal:attributes="name p">
-									<tal:block
-										tal:condition="python: prop_units != 'bytes'"
-										tal:repeat="prop_opt prop_options">
-										<option tal:attributes="value prop_opt" />
-										<span tal:replace="prop_opt" />
+									<tal:block tal:condition="python: prop_units != 'bytes'">
+										<tal:block tal:repeat="prop_opt prop_options">
+											<option tal:attributes="value prop_opt" />
+											<span tal:replace="prop_opt" />
+										</tal:block>
 									</tal:block>
-									<tal:block
-										tal:condition="python: prop_units == 'bytes'"
-										tal:repeat="prop_opt prop_options">
-										<option tal:attributes="value prop_opt" />
-										<span
+
+									<tal:block tal:condition="python: prop_units == 'bytes'">
+										<tal:block
 											tal:define="
-												dummy python: here.bytes_to_value_units(prop_opt);
-												value python: str(dummy[0]) + ' ' + str(dummy[1])"
-											tal:replace="value" />
+													dummy2 python:map(lambda x: int(x), prop_options);
+													dummy3 python:dummy2.sort()"
+											tal:repeat="prop_opt dummy2">
+												<option tal:attributes="
+															value prop_opt;
+															selected python:prop.get('default_val') == str(prop_opt) and 'selected' or ''" />
+												<span
+													tal:define="
+														dummy python: here.bytes_to_value_units(prop_opt);
+														value python: str(dummy[0]) + ' ' + str(dummy[1])"
+													tal:replace="value" />
+										</tal:block>
 									</tal:block>
 								</select>
 							</tal:block>
ricci/modules/cluster/clumon/REDHAT-CLUSTER-MIB +5 -5
@@ -13,7 +13,7 @@
 		   	    1801 Varsity Drive
 			    Raleigh, North Carolina 27606
 			    USA
-
+		  
 		  email:    customerservice at redhat.com
                  "
     DESCRIPTION  "Red Hat Cluster Suite MIB
@@ -28,7 +28,7 @@
 rhcMIBInfo		OBJECT IDENTIFIER ::= { RedHatCluster 1 }
 rhcCluster		OBJECT IDENTIFIER ::= { RedHatCluster 2 }
 rhcTables		OBJECT IDENTIFIER ::= { RedHatCluster 3 }
-
+	
 
 
 
@@ -86,7 +86,7 @@
 	MAX-ACCESS  read-only
 	STATUS      current
 	DESCRIPTION
-	"Minimum number of votes required for quorum.
+	"Minimum number of votes required for quorum. 
 	If cluster is not quorate, all services are stopped."
 	::= { rhcCluster 4 }
 
@@ -234,7 +234,7 @@
 	::= { rhcTables 1 }
 
 rhcNodeEntry OBJECT-TYPE
-	SYNTAX      RchNodeEntry
+	SYNTAX      RhcNodeEntry
 	MAX-ACCESS  not-accessible
 	STATUS      current
 	DESCRIPTION
@@ -311,7 +311,7 @@
 	::= { rhcTables 2 }
 
 rhcServiceEntry OBJECT-TYPE
-	SYNTAX      RchServiceEntry
+	SYNTAX      RhcServiceEntry
 	MAX-ACCESS  not-accessible
 	STATUS      current
 	DESCRIPTION
ricci/modules/rpm/PackageHandler.cpp +3 -0
@@ -511,9 +511,12 @@
 			if (kernel.find("xen") == kernel.npos) {
 				set.packages.push_back("kmod-gfs");
 				set.packages.push_back("kmod-gfs2");
+				set.packages.push_back("cmirror");
+				set.packages.push_back("kmod-cmirror");
 			} else {
 				set.packages.push_back("kmod-gfs-xen");
 				set.packages.push_back("kmod-gfs2-xen");
+				set.packages.push_back("kmod-cmirror-xen");
 			}
 		}
 	}
ricci/modules/service/ServiceManager.cpp +2 -1
@@ -521,11 +521,12 @@
 		servs.push_back("gfs");
 		servs.push_back("scsi_reserve");
 	} else if (RHEL5 || FC6) {
-		descr = "Shared Storage: clvmd, gfs, gfs2";
+		descr = "Shared Storage: clvmd, cmirror, gfs, gfs2";
 		servs.push_back("clvmd");
 		servs.push_back("gfs");
 		servs.push_back("gfs2");
 		servs.push_back("scsi_reserve");
+		servs.push_back("cmirror");
 	}
 	s = ServiceSet(name, descr);
 	if (populate_set(s, servs))
ricci/modules/storage/LVM.cpp +32 -12

56 lines not on this page · raw message

ricci/modules/virt/Makefile +8 -5
@@ -14,7 +14,7 @@
 include ${top_srcdir}/make/defines.mk
 
 
-TARGET = modvirt
+TARGET = ricci-modvirt
 
 OBJECTS = main.o \
 	VirtModule.o \
@@ -22,8 +22,11 @@
 
 PARANOID=0
 INCLUDE += -I${top_srcdir}/common/
-CXXFLAGS += -DPARANOIA=$(PARANOID)
-LDFLAGS += -lvirt
+CXXFLAGS += -DPARANOIA=$(PARANOID) -DVIRT_SUPPORT=$(VIRT_SUPPORT)
+
+ifeq ($(VIRT_SUPPORT), 1)
+	LDFLAGS += -lvirt
+endif
 
 ifeq ($(PARANOID), 1)
 	LDFLAGS += ${top_srcdir}/common/paranoid/*.o
@@ -39,9 +42,9 @@
 	$(INSTALL_DIR) ${libexecdir}
 	$(INSTALL_BIN) ${TARGET} ${libexecdir}
 	$(INSTALL_DIR) ${sysconfdir}/oddjobd.conf.d
-	$(INSTALL_FILE) d-bus/modvirt.oddjob.conf ${sysconfdir}/oddjobd.conf.d
+	$(INSTALL_FILE) d-bus/ricci-modvirt.oddjob.conf ${sysconfdir}/oddjobd.conf.d
 	$(INSTALL_DIR) ${sysconfdir}/dbus-1/system.d
-	$(INSTALL_FILE) d-bus/modvirt.systembus.conf ${sysconfdir}/dbus-1/system.d
+	$(INSTALL_FILE) d-bus/ricci-modvirt.systembus.conf ${sysconfdir}/dbus-1/system.d
 
 uninstall:
 
ricci/modules/virt/Virt.cpp +14 -0
@@ -23,7 +23,9 @@
 	#include <sys/stat.h>
 	#include <string.h>
 	#include <errno.h>
+#if VIRT_SUPPORT == 1
 	#include <libvirt/libvirt.h>
+#endif
 
 	#include "sys_util.h"
 	#include "base64.h"
@@ -53,6 +55,8 @@
 	return false;
 }
 
+#if VIRT_SUPPORT == 1
+
 map<String, String> Virt::get_vm_list(const String &hvURI) {
 	std::map<String, String> vm_list;
 	int i;
@@ -130,3 +134,13 @@
 	virConnectClose(con);
 	return vm_list;
 }
+
+#else
+
+map<String, String> Virt::get_vm_list(const String &hvURI) {
+	std::map<String, String> vm_list;
+	throw String("Unsupported on this architecture.");
+	return vm_list;
+}
+
+#endif
ricci/ricci/DBusController.cpp +1 -1
@@ -41,12 +41,12 @@
 DBusController::DBusController()
 {
 	// TODO: dynamically determine,
-	// currently, rpm requires storage and cluster modules
 	_mod_map["storage"]		= "modstorage_rw";
 	_mod_map["cluster"]		= "modcluster_rw";
 	_mod_map["rpm"]			= "modrpm_rw";
 	_mod_map["log"]			= "modlog_rw";
 	_mod_map["service"]		= "modservice_rw";
+	_mod_map["virt"]		= "modvirt_rw";
 	_mod_map["reboot"]		= "reboot";
 
 	MutexLocker lock(_dbus_mutex);
ricci/ricci/d-bus/ricci.oddjob.conf +3 -0
@@ -18,6 +18,9 @@
 			<method name="modservice_rw">
 				<allow user="ricci"/>
 			</method>
+			<method name="modvirt_rw">
+				<allow user="ricci"/>
+			</method>
                         <method name="reboot">
 				<helper exec="/sbin/reboot"
 					arguments="0"
ricci/test_suite/cluster/vm_list.xml +1 -1
@@ -2,7 +2,7 @@
 <ricci version="1.0" function="process_batch" async="false">
 <batch>
 
-<module name="cluster">
+<module name="virt">
 <request sequence="1254" API_version="1.0">
 <function_call name="list_vm" />
 </request>