From bd3c6bafe2346e6e69eca7b7357c14cedd4c0a08 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Thu, 27 Jun 2013 14:23:57 +0200 Subject: [PATCH 1/6] Correct ChangeLog, remove umount.glusterfs --- glusterfs.spec | 32 +++++++++++++++++--------------- umount.glusterfs | 4 ---- 2 files changed, 17 insertions(+), 19 deletions(-) delete mode 100644 umount.glusterfs diff --git a/glusterfs.spec b/glusterfs.spec index 05bc019..5800191 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -74,11 +74,10 @@ Source0: @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz %endif Source1: glusterd.sysconfig Source2: glusterfsd.sysconfig -Source3: umount.glusterfs -Source4: glusterfs-fuse.logrotate -Source5: glusterd.logrotate -Source6: glusterfsd.logrotate -Source7: rhel5-load-fuse-modules +Source3: glusterfs-fuse.logrotate +Source4: glusterd.logrotate +Source5: glusterfsd.logrotate +Source6: rhel5-load-fuse-modules Patch0: %{name}-3.2.5.configure.ac.patch Patch1: %{name}-3.3.0.libglusterfs.Makefile.patch Patch2: %{name}-3.3.1.rpc.rpcxprt.rdma.name.c.patch @@ -701,7 +700,12 @@ find %{buildroot}%{_libdir} -name '*.la' -delete # Remove installed docs, they're included by %%doc %{__rm} -rf %{buildroot}%{_datadir}/doc/glusterfs/ -tail -50 ChangeLog > ChangeLog.tail && mv ChangeLog.tail ChangeLog +head -50 ChangeLog > ChangeLog.head && mv ChangeLog.head ChangeLog +cat << EOM >> ChangeLog + +More commit messages for this ChangeLog can be found at +https://forge.gluster.org/glusterfs-core/glusterfs/commits/v%{version}%{?prereltag} +EOM # Remove benchmarking and other unpackaged files %{__rm} -rf %{buildroot}/benchmarking @@ -722,18 +726,15 @@ sed -i 's|option working-directory /etc/glusterd|option working-directory %{_sha %endif %if ( 0%{_for_fedora_koji_builds} ) -# Install wrapper umount script -%{__install} -D -p -m 0755 %{SOURCE3} \ - %{buildroot}/sbin/umount.glusterfs # Client logrotate entry -%{__install} -D -p -m 0644 %{SOURCE4} \ +%{__install} -D -p -m 0644 %{SOURCE3} \ %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs-fuse # Server logrotate entry -%{__install} -D -p -m 0644 %{SOURCE5} \ +%{__install} -D -p -m 0644 %{SOURCE4} \ %{buildroot}%{_sysconfdir}/logrotate.d/glusterd # Legacy server logrotate entry -%{__install} -D -p -m 0644 %{SOURCE6} \ +%{__install} -D -p -m 0644 %{SOURCE5} \ %{buildroot}%{_sysconfdir}/logrotate.d/glusterfsd %else %{__install} -D -p -m 0644 extras/glusterfs-logrotate \ @@ -939,9 +940,6 @@ fi %endif %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mount/fuse* /sbin/mount.glusterfs -%if ( 0%{_for_fedora_koji_builds} ) -/sbin/umount.glusterfs -%endif %if ( 0%{?_without_fusermount:1} ) %{_bindir}/fusermount-glusterfs %endif @@ -1437,6 +1435,10 @@ fi %endif %changelog +* Thu Jun 27 2013 Niels de Vos +- correct trimming the ChangeLog, keep the recent messages (#963027) +- remove the umount.glusterfs helper (#640620) + * Wed Jun 26 2013 Kaleb S. KEITHLEY - 3.4.0-0.7.beta3 - prerelease 3.4.0beta3 for oVirt/vdsm dependencies in Fedora19 - libgfapi and xlator/mount/api dependency fix diff --git a/umount.glusterfs b/umount.glusterfs deleted file mode 100644 index 9aefa5f..0000000 --- a/umount.glusterfs +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -umount "$1" - From 4a2a9c12b9a301d941535bebb910d3176def2297 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Wed, 3 Jul 2013 15:08:09 +0200 Subject: [PATCH 2/6] rpm: correct AutoRequires filtering on recent Fedora Recent Fedora releases (F17 and newer) do not need the __requires_exclude macro for filtering automatically generated Requires for .so files anymore. It is already sufficient to filter each .so from the Provides. This prevents the following (harmless) warning from being printed during build: Ignoring invalid regex -P ^(?!lib).*.so.*$ Upstream-bug: 972465 --- glusterfs.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/glusterfs.spec b/glusterfs.spec index 3472b0f..ffa1f03 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -227,8 +227,8 @@ Provides: %{name}-core = %{version}-%{release} %global __filter_from_req %{?__filter_from_req} | %{__grep} -v -P '^(?!lib).*\.so.*$' %filter_setup %else - # modern rpm and current Fedora - %global __requires_exclude -P ^(?!lib).*\.so.*$ + # modern rpm and current Fedora do not generate requires if the provides + # are filtered %global __provides_exclude_from ^%{_libdir}/glusterfs/%{version}/.*$ %endif @@ -1438,6 +1438,9 @@ fi %endif %changelog +* Wed Jul 3 2013 Niels de Vos +- correct AutoRequires filtering on recent Fedora (#972465) + * Fri Jun 28 2013 Kaleb S. KEITHLEY - 3.4.0-0.8.beta4 - prerelease 3.4.0beta4 for oVirt/vdsm dependencies in Fedora19 From fd0122005041a720eee37f1608c1a37a6ba95c6a Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 5 Jul 2013 11:51:42 +0200 Subject: [PATCH 3/6] Really include xlators/mount/api.so in the glusterfs-api package --- glusterfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/glusterfs.spec b/glusterfs.spec index ffa1f03..0704954 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -1016,7 +1016,7 @@ fi %files api %exclude %{_libdir}/*.so %{_libdir}/libgfapi.* -%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mount/fuse* +%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mount/api* %if ( 0%{!?_without_ocf:1} ) %files resource-agents @@ -1438,6 +1438,9 @@ fi %endif %changelog +* Fri Jul 5 2013 Niels de Vos +- include xlators/mount/api.so in the glusterfs-api package + * Wed Jul 3 2013 Niels de Vos - correct AutoRequires filtering on recent Fedora (#972465) From 3d0029655a310d85a806511d84e9fbb52dc39fc8 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Tue, 16 Jul 2013 21:24:35 -0400 Subject: [PATCH 4/6] glusterfs-3.4.0-2 --- sources | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources b/sources index ddee6c4..aee1922 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -963ffa93a8e24d4e1aec2e1b68cb90b7 glusterfs-3.3.2.tar.gz -1cfb85335eafc4317414736477d47dfc swift-1.7.4.tar.gz -c1041b0551be722363f18f3a5664d0cf gluster-swift-ufo-1.1.tar.gz +86d9aff765b6ac49f8b19e6ffad6adf9 glusterfs-3.4.0.tar.gz +0d2479c3cbb124fa3a6b001d0d4d5a8b swift-1.8.0.tar.gz +614628f29cd47fba95d1530363d7900b gluster-swift-ufo-1.2.tar.gz From 964843af9903daf687743e33f63ec3e4e9c7560b Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Tue, 1 Oct 2013 12:10:46 -0400 Subject: [PATCH 5/6] glusterfs-3.4.1-2, again --- glusterfs.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/glusterfs.spec b/glusterfs.spec index c1fff57..3fa0f54 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -454,11 +454,9 @@ sed -i 's|option working-directory /etc/glusterd|option working-directory %{_sha %{buildroot}%{_sysconfdir}/glusterfs/glusterd.vol # Install glusterfsd .service or init.d file -%if ( 0%{?_with_systemd:1} ) %if ( 0%{_for_fedora_koji_builds} ) %_init_install %{glusterfsd_service} glusterfsd %endif -%endif %if ( 0%{_for_fedora_koji_builds} ) # Client logrotate entry From d62d797fdb734c6c8807bf519b217847aec18aa4 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Wed, 29 May 2019 13:32:54 -0400 Subject: [PATCH 6/6] Ships in RHEL, obsoleted by CentOS Storage SIG --- .gitignore | 2 - ...e-for-serialization-in-memcache-but-.patch | 351 ----- ...llel-install-versions-of-epel-packag.patch | 53 - ...d-fixes-for-building-the-doc-package.patch | 37 - ...xes-for-building-the-doc-package.patch.180 | 37 - ...here-serialization_format-is-ignored.patch | 70 - account-server.conf | 16 - container-server.conf | 18 - dead.package | 1 + gluster-swift-account-auditor.service | 12 - gluster-swift-account-auditor@.service | 11 - gluster-swift-account-reaper.service | 11 - gluster-swift-account-reaper@.service | 11 - gluster-swift-account-replicator.service | 12 - gluster-swift-account-replicator@.service | 11 - gluster-swift-account.init | 78 -- gluster-swift-account.service | 11 - gluster-swift-account@.service | 11 - gluster-swift-container-auditor.service | 11 - gluster-swift-container-auditor@.service | 11 - gluster-swift-container-replicator.service | 12 - gluster-swift-container-replicator@.service | 11 - gluster-swift-container-updater.service | 11 - gluster-swift-container-updater@.service | 11 - gluster-swift-container.init | 78 -- gluster-swift-container.service | 11 - gluster-swift-container@.service | 11 - gluster-swift-functions | 64 - gluster-swift-object-auditor.service | 12 - gluster-swift-object-auditor@.service | 11 - gluster-swift-object-expirer.service | 11 - gluster-swift-object-expirer@.service | 11 - gluster-swift-object-replicator.service | 12 - gluster-swift-object-replicator@.service | 11 - gluster-swift-object-updater.service | 11 - gluster-swift-object-updater@.service | 11 - gluster-swift-object.init | 79 -- gluster-swift-object.service | 11 - gluster-swift-object@.service | 11 - gluster-swift-proxy.init | 79 -- gluster-swift-proxy.service | 11 - gluster-swift.tmpfs | 6 - glusterd.init | 109 -- glusterd.logrotate | 6 - glusterd.service | 13 - glusterd.sysconfig | 6 - glusterfs-3.2.5.configure.ac.patch | 11 - glusterfs-3.2.5.libglusterfs.Makefile.patch | 23 - ...ors.mgmt.glusterd.glusterd-rpc-ops.c.patch | 474 ------- glusterfs-3.3.0.cli.cli-rpc-ops.c.patch | 20 - glusterfs-3.3.0.libglusterfs.Makefile.patch | 24 - glusterfs-3.3.0.swift.patch | 797 ----------- ....3.0.xlator.mount.fuse.fuse-bridge.c.patch | 76 -- glusterfs-3.3.1.rpc.rpcxprt.rdma.name.c.patch | 11 - ...3.1.swift.constraints.backport-1.7.4.patch | 567 -------- ...rfs-3.3.1.swift.constraints.backport.patch | 518 ------- ...fo.gluster.multi-volume.backport-1.1.patch | 406 ------ ....gluster.swift.common.DiskFile-1.7.4.patch | 12 - glusterfs-3.3.2.libglusterfs.Makefile.patch | 24 - glusterfs-3.4.0.swift.egginfo-grizzly.patch | 9 - glusterfs-fuse.logrotate | 6 - glusterfs.logrotate | 6 - glusterfs.spec | 1211 ----------------- glusterfsd.init | 107 -- glusterfsd.logrotate | 6 - glusterfsd.service | 12 - glusterfsd.sysconfig | 6 - object-expirer.conf | 17 - object-server.conf | 16 - openstack-swift-docmod.patch | 14 - openstack-swift-newdeps.patch | 36 - openstack-swift-nonet.patch | 11 - proxy-server.conf | 39 - rhel5-load-fuse-modules | 7 - sources | 1 - swift.conf | 2 - 76 files changed, 1 insertion(+), 5873 deletions(-) delete mode 100644 .gitignore delete mode 100644 0001-Do-not-use-pickle-for-serialization-in-memcache-but-.patch delete mode 100644 0001-Use-updated-parallel-install-versions-of-epel-packag.patch delete mode 100644 0002-Add-fixes-for-building-the-doc-package.patch delete mode 100644 0002-Add-fixes-for-building-the-doc-package.patch.180 delete mode 100644 0002-Fix-bug-where-serialization_format-is-ignored.patch delete mode 100644 account-server.conf delete mode 100644 container-server.conf create mode 100644 dead.package delete mode 100644 gluster-swift-account-auditor.service delete mode 100644 gluster-swift-account-auditor@.service delete mode 100644 gluster-swift-account-reaper.service delete mode 100644 gluster-swift-account-reaper@.service delete mode 100644 gluster-swift-account-replicator.service delete mode 100644 gluster-swift-account-replicator@.service delete mode 100755 gluster-swift-account.init delete mode 100644 gluster-swift-account.service delete mode 100644 gluster-swift-account@.service delete mode 100644 gluster-swift-container-auditor.service delete mode 100644 gluster-swift-container-auditor@.service delete mode 100644 gluster-swift-container-replicator.service delete mode 100644 gluster-swift-container-replicator@.service delete mode 100644 gluster-swift-container-updater.service delete mode 100644 gluster-swift-container-updater@.service delete mode 100755 gluster-swift-container.init delete mode 100644 gluster-swift-container.service delete mode 100644 gluster-swift-container@.service delete mode 100644 gluster-swift-functions delete mode 100644 gluster-swift-object-auditor.service delete mode 100644 gluster-swift-object-auditor@.service delete mode 100644 gluster-swift-object-expirer.service delete mode 100644 gluster-swift-object-expirer@.service delete mode 100644 gluster-swift-object-replicator.service delete mode 100644 gluster-swift-object-replicator@.service delete mode 100644 gluster-swift-object-updater.service delete mode 100644 gluster-swift-object-updater@.service delete mode 100755 gluster-swift-object.init delete mode 100644 gluster-swift-object.service delete mode 100644 gluster-swift-object@.service delete mode 100755 gluster-swift-proxy.init delete mode 100644 gluster-swift-proxy.service delete mode 100644 gluster-swift.tmpfs delete mode 100644 glusterd.init delete mode 100644 glusterd.logrotate delete mode 100644 glusterd.service delete mode 100644 glusterd.sysconfig delete mode 100644 glusterfs-3.2.5.configure.ac.patch delete mode 100644 glusterfs-3.2.5.libglusterfs.Makefile.patch delete mode 100644 glusterfs-3.2.7.xlators.mgmt.glusterd.glusterd-rpc-ops.c.patch delete mode 100644 glusterfs-3.3.0.cli.cli-rpc-ops.c.patch delete mode 100644 glusterfs-3.3.0.libglusterfs.Makefile.patch delete mode 100644 glusterfs-3.3.0.swift.patch delete mode 100644 glusterfs-3.3.0.xlator.mount.fuse.fuse-bridge.c.patch delete mode 100644 glusterfs-3.3.1.rpc.rpcxprt.rdma.name.c.patch delete mode 100644 glusterfs-3.3.1.swift.constraints.backport-1.7.4.patch delete mode 100644 glusterfs-3.3.1.swift.constraints.backport.patch delete mode 100644 glusterfs-3.3.1.ufo.gluster.multi-volume.backport-1.1.patch delete mode 100644 glusterfs-3.3.1.ufo.gluster.swift.common.DiskFile-1.7.4.patch delete mode 100644 glusterfs-3.3.2.libglusterfs.Makefile.patch delete mode 100644 glusterfs-3.4.0.swift.egginfo-grizzly.patch delete mode 100644 glusterfs-fuse.logrotate delete mode 100644 glusterfs.logrotate delete mode 100644 glusterfs.spec delete mode 100644 glusterfsd.init delete mode 100644 glusterfsd.logrotate delete mode 100644 glusterfsd.service delete mode 100644 glusterfsd.sysconfig delete mode 100644 object-expirer.conf delete mode 100644 object-server.conf delete mode 100644 openstack-swift-docmod.patch delete mode 100644 openstack-swift-newdeps.patch delete mode 100644 openstack-swift-nonet.patch delete mode 100644 proxy-server.conf delete mode 100755 rhel5-load-fuse-modules delete mode 100644 sources delete mode 100644 swift.conf diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6e2ab76..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -gluster*.tar.gz -*.src.rpm diff --git a/0001-Do-not-use-pickle-for-serialization-in-memcache-but-.patch b/0001-Do-not-use-pickle-for-serialization-in-memcache-but-.patch deleted file mode 100644 index 6179ced..0000000 --- a/0001-Do-not-use-pickle-for-serialization-in-memcache-but-.patch +++ /dev/null @@ -1,351 +0,0 @@ -From c0619bd0c5eeb3d2f8af8b37575e11847664272c Mon Sep 17 00:00:00 2001 -From: Vincent Untz -Date: Thu, 21 Jun 2012 14:37:41 +0200 -Subject: [PATCH] Do not use pickle for serialization in memcache, but JSON - -We don't want to use pickle as it can execute arbitrary code. JSON is -safer. However, note that it supports serialization for only some -specific subset of object types; this should be enough for what we need, -though. - -To avoid issues on upgrades (unability to read pickled values, and cache -poisoning for old servers not understanding JSON), we add a -memcache_serialization_support configuration option, with the following -values: - - 0 = older, insecure pickle serialization (compatible, default in this release) - 1 = json serialization but pickles can still be read (still insecure) - 2 = json serialization only (secure, suggested, and the future default) - -To avoid an instant full cache flush, existing installations should -upgrade with 0, then set to 1 and reload, then after some time (24 -hours) set to 2 and reload. Support for 0 and 1 will be removed in -future versions. - -Part of bug 1006414. - -Patch Set 2: Added Vincent Untz to AUTHORS - -Change-Id: Id7d6d547b103b4f23ebf5be98b88f09ec6027ce4 ---- - doc/manpages/proxy-server.conf.5 | 15 ++++++++ - etc/memcache.conf-sample | 10 +++++ - etc/proxy-server.conf-sample | 12 ++++++ - swift/common/memcached.py | 48 +++++++++++++++++++++----- - swift/common/middleware/memcache.py | 30 ++++++++++++---- - test/unit/common/middleware/test_memcache.py | 5 ++- - test/unit/common/test_memcached.py | 22 ++++++++++++ - 7 files changed, 125 insertions(+), 17 deletions(-) - -diff --git a/doc/manpages/proxy-server.conf.5 b/doc/manpages/proxy-server.conf.5 -index 4979e4d..5cf5a7e 100644 ---- a/doc/manpages/proxy-server.conf.5 -+++ b/doc/manpages/proxy-server.conf.5 -@@ -205,6 +205,21 @@ Enables the ability to log request headers. The default is False. - .IP \fBmemcache_servers\fR - The memcache servers that are available. This can be a list separated by commas. The default - is 127.0.0.1:11211. -+.IP \fBmemcache_serialization_support\fR -+This sets how memcache values are serialized and deserialized: -+.RE -+ -+.PD 0 -+.RS 10 -+.IP "0 = older, insecure pickle serialization (default)" -+.IP "1 = json serialization but pickles can still be read (still insecure)" -+.IP "2 = json serialization only (secure)" -+.RE -+ -+.RS 10 -+To avoid an instant full cache flush, existing installations should upgrade with 0, then set to 1 and reload, then after some time (24 hours) set to 2 and reload. In the future, the ability to use pickle serialization will be removed. -+ -+If not set in the configuration file, the value for memcache_serialization_support will be read from /etc/swift/memcache.conf if it exists (see memcache.conf-sample). Otherwise, the default value as indicated above will be used. - .RE - - -diff --git a/etc/memcache.conf-sample b/etc/memcache.conf-sample -index 580d94a..cedfc19 100644 ---- a/etc/memcache.conf-sample -+++ b/etc/memcache.conf-sample -@@ -3,3 +3,13 @@ - # several other conf files under [filter:cache] for example. You can specify - # multiple servers separated with commas, as in: 10.1.2.3:11211,10.1.2.4:11211 - # memcache_servers = 127.0.0.1:11211 -+# -+# Sets how memcache values are serialized and deserialized: -+# 0 = older, insecure pickle serialization (compatible, default in this release) -+# 1 = json serialization but pickles can still be read (still insecure) -+# 2 = json serialization only (secure, suggested, and the future default) -+# To avoid an instant full cache flush, existing installations should -+# upgrade with 0, then set to 1 and reload, then after some time (24 hours) -+# set to 2 and reload. -+# In the future, the ability to use pickle serialization will be removed. -+# memcache_serialization_support = 0 -diff --git a/etc/proxy-server.conf-sample b/etc/proxy-server.conf-sample -index 148616b..18f711a 100644 ---- a/etc/proxy-server.conf-sample -+++ b/etc/proxy-server.conf-sample -@@ -122,6 +122,18 @@ use = egg:swift#memcache - # default to the value below. You can specify multiple servers separated with - # commas, as in: 10.1.2.3:11211,10.1.2.4:11211 - # memcache_servers = 127.0.0.1:11211 -+# -+# Sets how memcache values are serialized and deserialized: -+# 0 = older, insecure pickle serialization (compatible, default in this release) -+# 1 = json serialization but pickles can still be read (still insecure) -+# 2 = json serialization only (secure, suggested, and the future default) -+# If not set here, the value for memcache_serialization_support will be read -+# from /etc/swift/memcache.conf (see memcache.conf-sample). -+# To avoid an instant full cache flush, existing installations should -+# upgrade with 0, then set to 1 and reload, then after some time (24 hours) -+# set to 2 and reload. -+# In the future, the ability to use pickle serialization will be removed. -+# memcache_serialization_support = 0 - - [filter:ratelimit] - use = egg:swift#ratelimit -diff --git a/swift/common/memcached.py b/swift/common/memcached.py -index ecd9332..82ebb7a 100644 ---- a/swift/common/memcached.py -+++ b/swift/common/memcached.py -@@ -27,11 +27,17 @@ import time - from bisect import bisect - from hashlib import md5 - -+try: -+ import simplejson as json -+except ImportError: -+ import json -+ - DEFAULT_MEMCACHED_PORT = 11211 - - CONN_TIMEOUT = 0.3 - IO_TIMEOUT = 2.0 - PICKLE_FLAG = 1 -+JSON_FLAG = 2 - NODE_WEIGHT = 50 - PICKLE_PROTOCOL = 2 - TRY_COUNT = 3 -@@ -57,7 +63,8 @@ class MemcacheRing(object): - """ - - def __init__(self, servers, connect_timeout=CONN_TIMEOUT, -- io_timeout=IO_TIMEOUT, tries=TRY_COUNT): -+ io_timeout=IO_TIMEOUT, tries=TRY_COUNT, -+ allow_pickle=False, allow_unpickle=False): - self._ring = {} - self._errors = dict(((serv, []) for serv in servers)) - self._error_limited = dict(((serv, 0) for serv in servers)) -@@ -69,6 +76,8 @@ class MemcacheRing(object): - self._client_cache = dict(((server, []) for server in servers)) - self._connect_timeout = connect_timeout - self._io_timeout = io_timeout -+ self._allow_pickle = allow_pickle -+ self._allow_unpickle = allow_unpickle or allow_pickle - - def _exception_occurred(self, server, e, action='talking'): - if isinstance(e, socket.timeout): -@@ -130,16 +139,21 @@ class MemcacheRing(object): - - :param key: key - :param value: value -- :param serialize: if True, value is pickled before sending to memcache -+ :param serialize: if True, value is serialized with JSON before sending -+ to memcache, or with pickle if configured to use -+ pickle instead of JSON (to avoid cache poisoning) - :param timeout: ttl in memcache - """ - key = md5hash(key) - if timeout > 0: - timeout += time.time() - flags = 0 -- if serialize: -+ if serialize and self._allow_pickle: - value = pickle.dumps(value, PICKLE_PROTOCOL) - flags |= PICKLE_FLAG -+ elif serialize: -+ value = json.dumps(value) -+ flags |= JSON_FLAG - for (server, fp, sock) in self._get_conns(key): - try: - sock.sendall('set %s %d %d %s noreply\r\n%s\r\n' % \ -@@ -151,8 +165,9 @@ class MemcacheRing(object): - - def get(self, key): - """ -- Gets the object specified by key. It will also unpickle the object -- before returning if it is pickled in memcache. -+ Gets the object specified by key. It will also unserialize the object -+ before returning if it is serialized in memcache with JSON, or if it -+ is pickled and unpickling is allowed. - - :param key: key - :returns: value of the key in memcache -@@ -168,7 +183,12 @@ class MemcacheRing(object): - size = int(line[3]) - value = fp.read(size) - if int(line[2]) & PICKLE_FLAG: -- value = pickle.loads(value) -+ if self._allow_unpickle: -+ value = pickle.loads(value) -+ else: -+ value = None -+ elif int(line[2]) & JSON_FLAG: -+ value = json.loads(value) - fp.readline() - line = fp.readline().strip().split() - self._return_conn(server, fp, sock) -@@ -258,7 +278,9 @@ class MemcacheRing(object): - :param mapping: dictonary of keys and values to be set in memcache - :param servery_key: key to use in determining which server in the ring - is used -- :param serialize: if True, value is pickled before sending to memcache -+ :param serialize: if True, value is serialized with JSON before sending -+ to memcache, or with pickle if configured to use -+ pickle instead of JSON (to avoid cache poisoning) - :param timeout: ttl for memcache - """ - server_key = md5hash(server_key) -@@ -268,9 +290,12 @@ class MemcacheRing(object): - for key, value in mapping.iteritems(): - key = md5hash(key) - flags = 0 -- if serialize: -+ if serialize and self._allow_pickle: - value = pickle.dumps(value, PICKLE_PROTOCOL) - flags |= PICKLE_FLAG -+ elif serialize: -+ value = json.dumps(value) -+ flags |= JSON_FLAG - msg += ('set %s %d %d %s noreply\r\n%s\r\n' % - (key, flags, timeout, len(value), value)) - for (server, fp, sock) in self._get_conns(server_key): -@@ -302,7 +327,12 @@ class MemcacheRing(object): - size = int(line[3]) - value = fp.read(size) - if int(line[2]) & PICKLE_FLAG: -- value = pickle.loads(value) -+ if self._allow_unpickle: -+ value = pickle.loads(value) -+ else: -+ value = None -+ elif int(line[2]) & JSON_FLAG: -+ value = json.loads(value) - responses[line[1]] = value - fp.readline() - line = fp.readline().strip().split() -diff --git a/swift/common/middleware/memcache.py b/swift/common/middleware/memcache.py -index eb988bd..20121c9 100644 ---- a/swift/common/middleware/memcache.py -+++ b/swift/common/middleware/memcache.py -@@ -27,20 +27,36 @@ class MemcacheMiddleware(object): - def __init__(self, app, conf): - self.app = app - self.memcache_servers = conf.get('memcache_servers') -- if not self.memcache_servers: -+ serialization_format = conf.get('memcache_serialization_support') -+ -+ if not self.memcache_servers or serialization_format is None: - path = os.path.join(conf.get('swift_dir', '/etc/swift'), - 'memcache.conf') - memcache_conf = ConfigParser() - if memcache_conf.read(path): -- try: -- self.memcache_servers = \ -- memcache_conf.get('memcache', 'memcache_servers') -- except (NoSectionError, NoOptionError): -- pass -+ if not self.memcache_servers: -+ try: -+ self.memcache_servers = \ -+ memcache_conf.get('memcache', 'memcache_servers') -+ except (NoSectionError, NoOptionError): -+ pass -+ if serialization_format is None: -+ try: -+ serialization_format = \ -+ memcache_conf.get('memcache', -+ 'memcache_serialization_support') -+ except (NoSectionError, NoOptionError): -+ pass -+ - if not self.memcache_servers: - self.memcache_servers = '127.0.0.1:11211' -+ if serialization_format is None: -+ serialization_format = 0 -+ - self.memcache = MemcacheRing( -- [s.strip() for s in self.memcache_servers.split(',') if s.strip()]) -+ [s.strip() for s in self.memcache_servers.split(',') if s.strip()], -+ allow_pickle=(serialization_format == 0), -+ allow_unpickle=(serialization_format <= 1)) - - def __call__(self, env, start_response): - env['swift.cache'] = self.memcache -diff --git a/test/unit/common/middleware/test_memcache.py b/test/unit/common/middleware/test_memcache.py -index 6b94bd1..e217a96 100644 ---- a/test/unit/common/middleware/test_memcache.py -+++ b/test/unit/common/middleware/test_memcache.py -@@ -47,6 +47,8 @@ class SetConfigParser(object): - if section == 'memcache': - if option == 'memcache_servers': - return '1.2.3.4:5' -+ elif option == 'memcache_serialization_support': -+ return '2' - else: - raise NoOptionError(option) - else: -@@ -86,7 +88,8 @@ class TestCacheMiddleware(unittest.TestCase): - exc = None - try: - app = memcache.MemcacheMiddleware( -- FakeApp(), {'memcache_servers': '1.2.3.4:5'}) -+ FakeApp(), {'memcache_servers': '1.2.3.4:5', -+ 'memcache_serialization_support': '2'}) - except Exception, err: - exc = err - finally: -diff --git a/test/unit/common/test_memcached.py b/test/unit/common/test_memcached.py -index dff6e80..3016d10 100644 ---- a/test/unit/common/test_memcached.py -+++ b/test/unit/common/test_memcached.py -@@ -1,3 +1,4 @@ -+ # -*- coding: utf8 -*- - # Copyright (c) 2010-2012 OpenStack, LLC. - # - # Licensed under the Apache License, Version 2.0 (the "License"); -@@ -166,6 +167,9 @@ class TestMemcached(unittest.TestCase): - self.assertEquals(memcache_client.get('some_key'), [1, 2, 3]) - memcache_client.set('some_key', [4, 5, 6]) - self.assertEquals(memcache_client.get('some_key'), [4, 5, 6]) -+ memcache_client.set('some_key', ['simple str', 'utf8 str éà']) -+ # As per http://wiki.openstack.org/encoding, we should expect to have unicode -+ self.assertEquals(memcache_client.get('some_key'), ['simple str', u'utf8 str éà']) - self.assert_(float(mock.cache.values()[0][1]) == 0) - esttimeout = time.time() + 10 - memcache_client.set('some_key', [1, 2, 3], timeout=10) -@@ -244,6 +248,24 @@ class TestMemcached(unittest.TestCase): - self.assertEquals(memcache_client.get_multi(('some_key2', 'some_key1', - 'not_exists'), 'multi_key'), [[4, 5, 6], [1, 2, 3], None]) - -+ def test_serialization(self): -+ memcache_client = memcached.MemcacheRing(['1.2.3.4:11211'], -+ allow_pickle=True) -+ mock = MockMemcached() -+ memcache_client._client_cache['1.2.3.4:11211'] = [(mock, mock)] * 2 -+ memcache_client.set('some_key', [1, 2, 3]) -+ self.assertEquals(memcache_client.get('some_key'), [1, 2, 3]) -+ memcache_client._allow_pickle = False -+ memcache_client._allow_unpickle = True -+ self.assertEquals(memcache_client.get('some_key'), [1, 2, 3]) -+ memcache_client._allow_unpickle = False -+ self.assertEquals(memcache_client.get('some_key'), None) -+ memcache_client.set('some_key', [1, 2, 3]) -+ self.assertEquals(memcache_client.get('some_key'), [1, 2, 3]) -+ memcache_client._allow_unpickle = True -+ self.assertEquals(memcache_client.get('some_key'), [1, 2, 3]) -+ memcache_client._allow_pickle = True -+ self.assertEquals(memcache_client.get('some_key'), [1, 2, 3]) - - if __name__ == '__main__': - unittest.main() diff --git a/0001-Use-updated-parallel-install-versions-of-epel-packag.patch b/0001-Use-updated-parallel-install-versions-of-epel-packag.patch deleted file mode 100644 index 309b08b..0000000 --- a/0001-Use-updated-parallel-install-versions-of-epel-packag.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 43e8681d5cbd6c919e379fe25cccc189827e2d60 Mon Sep 17 00:00:00 2001 -From: Alan Pevec -Date: Wed, 4 Jan 2012 00:15:05 +0100 -Subject: [PATCH] Use updated parallel install versions of epel package -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Use WebOb >= 1.0 -and depend on the EPEL parallel installable versions of the package -to satisfy those requirements. -Based on Nova/Glance EPEL patch by Pádraig Brady ---- - swift/__init__.py | 29 +++++++++++++++++++++++++++++ - 1 file changed, 29 insertions(+) - -diff --git a/swift/__init__.py b/swift/__init__.py -index 9065801..9600d1e 100644 ---- a/swift/__init__.py -+++ b/swift/__init__.py -@@ -1,3 +1,32 @@ -+import sys -+import pkg_resources -+ -+# If there is a conflicting non egg module, -+# i.e. an older standard system module installed, -+# then replace it with this requirement -+def replace_dist(requirement): -+ try: -+ return pkg_resources.require(requirement) -+ except pkg_resources.VersionConflict: -+ e = sys.exc_info()[1] -+ dist=e.args[0] -+ req=e.args[1] -+ if dist.key == req.key and not dist.location.endswith('.egg'): -+ del pkg_resources.working_set.by_key[dist.key] -+ # We assume there is no need to adjust sys.path -+ # and the associated pkg_resources.working_set.entries -+ return pkg_resources.require(requirement) -+ -+replace_dist("WebOb >= 1.0") -+ -+replace_dist("PasteDeploy >= 1.5.0") -+# This hack is needed because replace_dist() results in -+# the standard paste module path being at the start of __path__. -+# TODO: See can we get pkg_resources to do the right thing directly -+import paste -+paste.__path__.insert(0, paste.__path__.pop(-1)) -+ -+ - import gettext - - diff --git a/0002-Add-fixes-for-building-the-doc-package.patch b/0002-Add-fixes-for-building-the-doc-package.patch deleted file mode 100644 index f8a173d..0000000 --- a/0002-Add-fixes-for-building-the-doc-package.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 7df10fb14d27e35faa590770594ea1b05552576f Mon Sep 17 00:00:00 2001 -From: Alan Pevec -Date: Thu, 5 Jan 2012 00:03:00 +0100 -Subject: [PATCH] Add fixes for building the doc package -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Don't access the net and always reference -the swift module from the package we're building -Based on Nova/Glance EPEL patch by Pádraig Brady ---- - doc/source/conf.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/doc/source/conf.py b/doc/source/conf.py -index e6a43b0..3734cd4 100644 ---- a/doc/source/conf.py -+++ b/doc/source/conf.py -@@ -33,14 +33,14 @@ import os - # If extensions (or modules to document with autodoc) are in another directory, - # add these directories to sys.path here. If the directory is relative to the - # documentation root, use os.path.abspath to make it absolute, like shown here. --sys.path.append([os.path.abspath('../swift'), os.path.abspath('..'), -- os.path.abspath('../bin')]) -+sys.path.extend([os.path.abspath('../../swift'), os.path.abspath('../..'), -+ os.path.abspath('../../bin')]) - - # -- General configuration ---------------------------------------------------- - - # Add any Sphinx extension module names here, as strings. They can be - # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. --extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', -+extensions = ['sphinx.ext.autodoc', - 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', - 'sphinx.ext.ifconfig'] - todo_include_todos = True diff --git a/0002-Add-fixes-for-building-the-doc-package.patch.180 b/0002-Add-fixes-for-building-the-doc-package.patch.180 deleted file mode 100644 index a3c1856..0000000 --- a/0002-Add-fixes-for-building-the-doc-package.patch.180 +++ /dev/null @@ -1,37 +0,0 @@ -From 7df10fb14d27e35faa590770594ea1b05552576f Mon Sep 17 00:00:00 2001 -From: Alan Pevec -Date: Thu, 5 Jan 2012 00:03:00 +0100 -Subject: [PATCH] Add fixes for building the doc package -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Don't access the net and always reference -the swift module from the package we're building -Based on Nova/Glance EPEL patch by Pádraig Brady ---- - doc/source/conf.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/doc/source/conf.py b/doc/source/conf.py -index e6a43b0..3734cd4 100644 ---- a/doc/source/conf.py -+++ b/doc/source/conf.py -@@ -20,14 +20,14 @@ import os - # If extensions (or modules to document with autodoc) are in another directory, - # add these directories to sys.path here. If the directory is relative to the - # documentation root, use os.path.abspath to make it absolute, like shown here. --sys.path.extend([os.path.abspath('../swift'), os.path.abspath('..'), -- os.path.abspath('../bin')]) -+sys.path.extend([os.path.abspath('../../swift'), os.path.abspath('../..'), -+ os.path.abspath('../../bin')]) - - # -- General configuration ---------------------------------------------------- - - # Add any Sphinx extension module names here, as strings. They can be - # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. --extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', -+extensions = ['sphinx.ext.autodoc', - 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', - 'sphinx.ext.ifconfig'] - todo_include_todos = True diff --git a/0002-Fix-bug-where-serialization_format-is-ignored.patch b/0002-Fix-bug-where-serialization_format-is-ignored.patch deleted file mode 100644 index 4f7e4b4..0000000 --- a/0002-Fix-bug-where-serialization_format-is-ignored.patch +++ /dev/null @@ -1,70 +0,0 @@ -From c38568f026853f64f2669f03bd56441b007f13be Mon Sep 17 00:00:00 2001 -From: gholt -Date: Tue, 18 Sep 2012 18:24:47 +0000 -Subject: [PATCH] Fix bug where serialization_format is ignored - -Change-Id: I5a5ac8b5f18e077105ab12e9b1f0ccafac3983f7 ---- - swift/common/middleware/memcache.py | 2 ++ - test/unit/common/middleware/test_memcache.py | 12 ++++++++++-- - 2 files changed, 12 insertions(+), 2 deletions(-) - -diff --git a/swift/common/middleware/memcache.py b/swift/common/middleware/memcache.py -index 20121c9..06678c4 100644 ---- a/swift/common/middleware/memcache.py -+++ b/swift/common/middleware/memcache.py -@@ -52,6 +52,8 @@ class MemcacheMiddleware(object): - self.memcache_servers = '127.0.0.1:11211' - if serialization_format is None: - serialization_format = 0 -+ else: -+ serialization_format = int(serialization_format) - - self.memcache = MemcacheRing( - [s.strip() for s in self.memcache_servers.split(',') if s.strip()], -diff --git a/test/unit/common/middleware/test_memcache.py b/test/unit/common/middleware/test_memcache.py -index e217a96..28c7b13 100644 ---- a/test/unit/common/middleware/test_memcache.py -+++ b/test/unit/common/middleware/test_memcache.py -@@ -48,7 +48,7 @@ class SetConfigParser(object): - if option == 'memcache_servers': - return '1.2.3.4:5' - elif option == 'memcache_serialization_support': -- return '2' -+ return '1' - else: - raise NoOptionError(option) - else: -@@ -104,6 +104,8 @@ class TestCacheMiddleware(unittest.TestCase): - finally: - memcache.ConfigParser = orig_parser - self.assertEquals(app.memcache_servers, '127.0.0.1:11211') -+ self.assertEquals(app.memcache._allow_pickle, True) -+ self.assertEquals(app.memcache._allow_unpickle, True) - - def test_conf_from_extra_conf(self): - orig_parser = memcache.ConfigParser -@@ -113,16 +115,22 @@ class TestCacheMiddleware(unittest.TestCase): - finally: - memcache.ConfigParser = orig_parser - self.assertEquals(app.memcache_servers, '1.2.3.4:5') -+ self.assertEquals(app.memcache._allow_pickle, False) -+ self.assertEquals(app.memcache._allow_unpickle, True) - - def test_conf_from_inline_conf(self): - orig_parser = memcache.ConfigParser - memcache.ConfigParser = SetConfigParser - try: - app = memcache.MemcacheMiddleware( -- FakeApp(), {'memcache_servers': '6.7.8.9:10'}) -+ FakeApp(), -+ {'memcache_servers': '6.7.8.9:10', -+ 'serialization_format': '0'}) - finally: - memcache.ConfigParser = orig_parser - self.assertEquals(app.memcache_servers, '6.7.8.9:10') -+ self.assertEquals(app.memcache._allow_pickle, False) -+ self.assertEquals(app.memcache._allow_unpickle, True) - - - if __name__ == '__main__': diff --git a/account-server.conf b/account-server.conf deleted file mode 100644 index 1ffca8b..0000000 --- a/account-server.conf +++ /dev/null @@ -1,16 +0,0 @@ -[DEFAULT] -bind_ip = 127.0.0.1 -bind_port = 6012 -workers = 2 - -[pipeline:main] -pipeline = account-server - -[app:account-server] -use = egg:swift#account - -[account-replicator] - -[account-auditor] - -[account-reaper] diff --git a/container-server.conf b/container-server.conf deleted file mode 100644 index fa0de88..0000000 --- a/container-server.conf +++ /dev/null @@ -1,18 +0,0 @@ -[DEFAULT] -bind_ip = 127.0.0.1 -bind_port = 6011 -workers = 2 - -[pipeline:main] -pipeline = container-server - -[app:container-server] -use = egg:swift#container - -[container-replicator] - -[container-updater] - -[container-auditor] - -[container-sync] diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..3ce6df9 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +Ships in RHEL, obsoleted by CentOS Storage SIG diff --git a/gluster-swift-account-auditor.service b/gluster-swift-account-auditor.service deleted file mode 100644 index 35413ce..0000000 --- a/gluster-swift-account-auditor.service +++ /dev/null @@ -1,12 +0,0 @@ -# After network.target just because. -[Unit] -Description=OpenStack Object Storage (swift) - Account Auditor -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-account-auditor /etc/swift/account-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-account-auditor@.service b/gluster-swift-account-auditor@.service deleted file mode 100644 index 8b44df9..0000000 --- a/gluster-swift-account-auditor@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Account Auditor instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-account-auditor /etc/swift/account-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-account-reaper.service b/gluster-swift-account-reaper.service deleted file mode 100644 index dd6fb00..0000000 --- a/gluster-swift-account-reaper.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Account Reaper -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-account-reaper /etc/swift/account-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-account-reaper@.service b/gluster-swift-account-reaper@.service deleted file mode 100644 index dbd5aa4..0000000 --- a/gluster-swift-account-reaper@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Account Reaper instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-account-reaper /etc/swift/account-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-account-replicator.service b/gluster-swift-account-replicator.service deleted file mode 100644 index 0cad889..0000000 --- a/gluster-swift-account-replicator.service +++ /dev/null @@ -1,12 +0,0 @@ -# After network.target just so replicator can talk to other nodes. -[Unit] -Description=OpenStack Object Storage (swift) - Account Replicator -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-account-replicator /etc/swift/account-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-account-replicator@.service b/gluster-swift-account-replicator@.service deleted file mode 100644 index 65fbaa3..0000000 --- a/gluster-swift-account-replicator@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Account Replicator instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-account-replicator /etc/swift/account-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-account.init b/gluster-swift-account.init deleted file mode 100755 index 4f1dbfd..0000000 --- a/gluster-swift-account.init +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: gluster-swift-account -# Required-Start: $remote_fs -# Required-Stop: $remote_fs -# Default-Stop: 0 1 6 -# Short-Description: Swift account server -# Description: Account server for swift. -### END INIT INFO - -# gluster-swift-account: swift account server -# -# chkconfig: - 20 80 -# description: Account server for swift. - -. /etc/rc.d/init.d/functions -. /usr/share/gluster-swift/functions - -name="account" - -[ -e "/etc/sysconfig/gluster-swift-$name" ] && . "/etc/sysconfig/gluster-swift-$name" - -lockfile="/var/lock/subsys/gluster-swift-account" - -start() { - swift_action "$name" start - retval=$? - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - swift_action "$name" stop - retval=$? - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -rh_status() { - swift_action "$name" status -} - -rh_status_q() { - rh_status &> /dev/null -} - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" - exit 2 -esac -exit $? diff --git a/gluster-swift-account.service b/gluster-swift-account.service deleted file mode 100644 index 782b06a..0000000 --- a/gluster-swift-account.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Account Server -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-account-server /etc/swift/account-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-account@.service b/gluster-swift-account@.service deleted file mode 100644 index cae48c7..0000000 --- a/gluster-swift-account@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Account Server instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-account-server /etc/swift/account-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-container-auditor.service b/gluster-swift-container-auditor.service deleted file mode 100644 index 6359b91..0000000 --- a/gluster-swift-container-auditor.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Container Auditor -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-container-auditor /etc/swift/container-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-container-auditor@.service b/gluster-swift-container-auditor@.service deleted file mode 100644 index 7c046da..0000000 --- a/gluster-swift-container-auditor@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Container Auditor instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-container-auditor /etc/swift/container-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-container-replicator.service b/gluster-swift-container-replicator.service deleted file mode 100644 index 399f7b4..0000000 --- a/gluster-swift-container-replicator.service +++ /dev/null @@ -1,12 +0,0 @@ -# After network.target just so replicator can talk to other nodes. -[Unit] -Description=OpenStack Object Storage (swift) - Container Replicator -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-container-replicator /etc/swift/container-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-container-replicator@.service b/gluster-swift-container-replicator@.service deleted file mode 100644 index 4803503..0000000 --- a/gluster-swift-container-replicator@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Container Replicator instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-container-replicator /etc/swift/container-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-container-updater.service b/gluster-swift-container-updater.service deleted file mode 100644 index 6efc57e..0000000 --- a/gluster-swift-container-updater.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Container Updater -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-container-updater /etc/swift/container-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-container-updater@.service b/gluster-swift-container-updater@.service deleted file mode 100644 index 19f99ff..0000000 --- a/gluster-swift-container-updater@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Container Updater instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-container-updater /etc/swift/container-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-container.init b/gluster-swift-container.init deleted file mode 100755 index 1d27989..0000000 --- a/gluster-swift-container.init +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: gluster-swift-container -# Required-Start: $remote_fs -# Required-Stop: $remote_fs -# Default-Stop: 0 1 6 -# Short-Description: Swift container server -# Description: Container server for swift. -### END INIT INFO - -# gluster-swift-container: swift container server -# -# chkconfig: - 20 80 -# description: Container server for swift. - -. /etc/rc.d/init.d/functions -. /usr/share/gluster-swift/functions - -name="container" - -[ -e "/etc/sysconfig/gluster-swift-$name" ] && . "/etc/sysconfig/gluster-swift-$name" - -lockfile="/var/lock/subsys/gluster-swift-container" - -start() { - swift_action "$name" start - retval=$? - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - swift_action "$name" stop - retval=$? - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -rh_status() { - swift_action "$name" status -} - -rh_status_q() { - rh_status &> /dev/null -} - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" - exit 2 -esac -exit $? diff --git a/gluster-swift-container.service b/gluster-swift-container.service deleted file mode 100644 index 6db2b51..0000000 --- a/gluster-swift-container.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Container Server -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-container-server /etc/swift/container-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-container@.service b/gluster-swift-container@.service deleted file mode 100644 index 4f51e3f..0000000 --- a/gluster-swift-container@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Container Server instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-container-server /etc/swift/container-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-functions b/gluster-swift-functions deleted file mode 100644 index 4b69ed8..0000000 --- a/gluster-swift-functions +++ /dev/null @@ -1,64 +0,0 @@ -# vim: filetype=sh - -. /etc/rc.d/init.d/functions - -swift_action() { - retval=0 - server="$1" - call="swift_$2" - - if [[ -f "/etc/swift/$server-server.conf" ]]; then - $call "$server" \ - "/etc/swift/$server-server.conf" \ - "/var/run/swift/$server-server.pid" - [ $? -ne 0 ] && retval=1 - elif [[ -d "/etc/swift/$server-server/" ]]; then - declare -i count=0 - mkdir -p /var/run/swift/$server-server - for name in $( ls "/etc/swift/$server-server/" ); do - $call "$server" \ - "/etc/swift/$server-server/$name" \ - "/var/run/swift/$server-server/$count.pid" - [ $? -ne 0 ] && retval=1 - count=$count+1 - done - fi - return $retval -} - -swift_start() { - name="$1" - long_name="$name-server" - conf_file="$2" - pid_file="$3" - - ulimit -n ${SWIFT_MAX_FILES-32768} - echo -n "Starting swift-$long_name: " - daemon --pidfile $pid_file \ - "/usr/bin/swift-$long_name $conf_file &>/var/log/swift-startup.log & echo \$! > $pid_file" - retval=$? - echo - return $retval -} - -swift_stop() { - name="$1" - long_name="$name-server" - conf_name="$2" - pid_file="$3" - - echo -n "Stopping swift-$long_name: " - killproc -p $pid_file -d ${SWIFT_STOP_DELAY-15} $long_name - retval=$? - echo - return $retval -} - -swift_status() { - name="$1" - long_name="$name-server" - conf_name="$2" - pid_file="$3" - - status -p $pid_file $long_name -} diff --git a/gluster-swift-object-auditor.service b/gluster-swift-object-auditor.service deleted file mode 100644 index 498d53e..0000000 --- a/gluster-swift-object-auditor.service +++ /dev/null @@ -1,12 +0,0 @@ -# After network.target just because. -[Unit] -Description=OpenStack Object Storage (swift) - Object Auditor -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-object-auditor /etc/swift/object-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-object-auditor@.service b/gluster-swift-object-auditor@.service deleted file mode 100644 index f5c2537..0000000 --- a/gluster-swift-object-auditor@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Object Auditor instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-object-auditor /etc/swift/object-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-object-expirer.service b/gluster-swift-object-expirer.service deleted file mode 100644 index 1438427..0000000 --- a/gluster-swift-object-expirer.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Object Expirer -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-object-expirer /etc/swift/object-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-object-expirer@.service b/gluster-swift-object-expirer@.service deleted file mode 100644 index e7d03c3..0000000 --- a/gluster-swift-object-expirer@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Object Expirer instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-object-expirer /etc/swift/object-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-object-replicator.service b/gluster-swift-object-replicator.service deleted file mode 100644 index be1d3fa..0000000 --- a/gluster-swift-object-replicator.service +++ /dev/null @@ -1,12 +0,0 @@ -# After network.target just so replicator can talk to other nodes. -[Unit] -Description=OpenStack Object Storage (swift) - Object Replicator -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-object-replicator /etc/swift/object-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-object-replicator@.service b/gluster-swift-object-replicator@.service deleted file mode 100644 index 7493398..0000000 --- a/gluster-swift-object-replicator@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Object Replicator instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-object-replicator /etc/swift/object-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-object-updater.service b/gluster-swift-object-updater.service deleted file mode 100644 index d9697a5..0000000 --- a/gluster-swift-object-updater.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Object Updater -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-object-updater /etc/swift/object-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-object-updater@.service b/gluster-swift-object-updater@.service deleted file mode 100644 index 9f223c7..0000000 --- a/gluster-swift-object-updater@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Object Updater instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-object-updater /etc/swift/object-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-object.init b/gluster-swift-object.init deleted file mode 100755 index f0fe540..0000000 --- a/gluster-swift-object.init +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: gluster-swift-object -# Required-Start: $remote_fs -# Required-Stop: $remote_fs -# Default-Stop: 0 1 6 -# Short-Description: Swift object server -# Description: Object server for swift. -### END INIT INFO - -# gluster-swift-object: swift object server -# -# chkconfig: - 20 80 -# description: Object server for swift. - -. /etc/rc.d/init.d/functions -. /usr/share/gluster-swift/functions - -name="object" - -[ -e "/etc/sysconfig/gluster-swift-$name" ] && . "/etc/sysconfig/gluster-swift-$name" - -lockfile="/var/lock/subsys/gluster-swift-object" - -start() { - swift_action "$name" start - retval=$? - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - swift_action "$name" stop - retval=$? - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -rh_status() { - swift_action "$name" status -} - -rh_status_q() { - rh_status &> /dev/null -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" - exit 2 -esac -exit $? diff --git a/gluster-swift-object.service b/gluster-swift-object.service deleted file mode 100644 index 1cd5020..0000000 --- a/gluster-swift-object.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Object Server -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-object-server /etc/swift/object-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-object@.service b/gluster-swift-object@.service deleted file mode 100644 index 172e322..0000000 --- a/gluster-swift-object@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Object Server instance %I -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-object-server /etc/swift/object-server/%i.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift-proxy.init b/gluster-swift-proxy.init deleted file mode 100755 index 052e05f..0000000 --- a/gluster-swift-proxy.init +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: gluster-swift-proxy -# Required-Start: $remote_fs -# Required-Stop: $remote_fs -# Default-Stop: 0 1 6 -# Short-Description: Swift proxy server -# Description: Account server for swift. -### END INIT INFO - -# gluster-swift-proxy: swift proxy server -# -# chkconfig: - 20 80 -# description: Proxy server for swift. - -. /etc/rc.d/init.d/functions -. /usr/share/gluster-swift/functions - -name="proxy" - -[ -e "/etc/sysconfig/gluster-swift-$name" ] && . "/etc/sysconfig/gluster-swift-$name" - -lockfile="/var/lock/subsys/gluster-swift-proxy" - -start() { - swift_action "$name" start - retval=$? - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - swift_action "$name" stop - retval=$? - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -rh_status() { - swift_action "$name" status -} - -rh_status_q() { - rh_status &> /dev/null -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" - exit 2 -esac -exit $? diff --git a/gluster-swift-proxy.service b/gluster-swift-proxy.service deleted file mode 100644 index 4078f50..0000000 --- a/gluster-swift-proxy.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenStack Object Storage (swift) - Proxy Server -After=syslog.target network.target - -[Service] -Type=simple -User=swift -ExecStart=/usr/bin/swift-proxy-server /etc/swift/proxy-server.conf - -[Install] -WantedBy=multi-user.target diff --git a/gluster-swift.tmpfs b/gluster-swift.tmpfs deleted file mode 100644 index 8f4f5a5..0000000 --- a/gluster-swift.tmpfs +++ /dev/null @@ -1,6 +0,0 @@ -# swift needs a couple of directories in /var/run -d /var/run/swift 0755 swift root -d /var/run/swift/account-server 0755 swift root -d /var/run/swift/container-server 0755 swift root -d /var/run/swift/object-server 0755 swift root -d /var/run/swift/proxy-server 0755 swift root diff --git a/glusterd.init b/glusterd.init deleted file mode 100644 index 0007d2e..0000000 --- a/glusterd.init +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/sh -# -# glusterd Startup script for the glusterfs server -# -# chkconfig: - 20 80 -# description: Clustered file-system server - -### BEGIN INIT INFO -# Provides: glusterd -# Required-Start: $local_fs $network -# Required-Stop: $local_fs $network -# Should-Start: -# Should-Stop: -# Default-Start: -# Default-Stop: 0 1 2 3 4 5 6 -# Short-Description: glusterfs server -# Description: Clustered file-system server -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -exe="/usr/sbin/glusterd" -prog="glusterd" - -# Fedora File System Layout dictates /run -[ -e /run ] && RUNDIR="/run" -pidf="${RUNDIR:-/var/run}/$prog.pid" - -# Set defaults, then source config for eventual overrides -GLUSTERD_NOFILE="65536" - -[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog - -lockfile=/var/lock/subsys/$prog - -start() { - [ -x $exe ] || exit 5 - ulimit -n $GLUSTERD_NOFILE - echo -n $"Starting $prog: " - daemon $exe${GLUSTERD_LOGFILE+" -l $GLUSTERD_LOGFILE"}${GLUSTERD_LOGLEVEL+" -L $GLUSTERD_LOGLEVEL"} -p $pidf - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - status $prog -} - -rh_status_q() { - rh_status &>/dev/null -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/glusterd.logrotate b/glusterd.logrotate deleted file mode 100644 index 3fce646..0000000 --- a/glusterd.logrotate +++ /dev/null @@ -1,6 +0,0 @@ -/var/log/glusterfs/*glusterd.vol.log { - missingok - postrotate - /bin/kill -HUP `cat /var/run/glusterd.pid 2>/dev/null` 2>/dev/null || true - endscript -} diff --git a/glusterd.service b/glusterd.service deleted file mode 100644 index d19d962..0000000 --- a/glusterd.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=GlusterFS an clustered file-system server -Wants=glusterfsd.service -After=network.target rpcbind.service - -[Service] -Type=forking -PIDFile=/run/glusterd.pid -LimitNOFILE=65536 -ExecStart=/usr/sbin/glusterd -p /run/glusterd.pid - -[Install] -WantedBy=multi-user.target diff --git a/glusterd.sysconfig b/glusterd.sysconfig deleted file mode 100644 index 3a9cb86..0000000 --- a/glusterd.sysconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Change the glusterd service defaults here. -# See "glusterd --help" outpout for defaults and possible values. - -#GLUSTERD_LOGFILE="/var/log/gluster/gluster.log" -#GLUSTERD_LOGLEVEL="NORMAL" - diff --git a/glusterfs-3.2.5.configure.ac.patch b/glusterfs-3.2.5.configure.ac.patch deleted file mode 100644 index 122af1a..0000000 --- a/glusterfs-3.2.5.configure.ac.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- configure.ac.orig 2012-01-16 13:38:53.020000114 -0500 -+++ configure.ac 2012-01-16 13:39:29.177000589 -0500 -@@ -431,7 +431,7 @@ - linux*) - dnl GF_LINUX_HOST_OS=1 - GF_HOST_OS="GF_LINUX_HOST_OS" -- GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -O0" -+ GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -O2" - GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}" - GF_LDADD="${ARGP_STANDALONE_LDADD}" - GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(bindir)\\\"" diff --git a/glusterfs-3.2.5.libglusterfs.Makefile.patch b/glusterfs-3.2.5.libglusterfs.Makefile.patch deleted file mode 100644 index 56a84b0..0000000 --- a/glusterfs-3.2.5.libglusterfs.Makefile.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- libglusterfs/src/Makefile.am.orig 2011-11-23 14:04:41.810001717 -0500 -+++ libglusterfs/src/Makefile.am 2011-11-23 14:30:49.940000394 -0500 -@@ -16,6 +16,7 @@ - $(LEX) -t $(srcdir)/graph.l > $@ - - y.tab.c y.tab.h: graph.y -- $(YACC) -d $(srcdir)/graph.y -+ $(YACC) -d -b foo $(srcdir)/graph.y -+ mv foo.tab.h y.tab.h && mv foo.tab.c y.tab.c - - CLEANFILES = graph.lex.c y.tab.c y.tab.h ---- libglusterfs/src/Makefile.in.orig 2011-11-23 14:04:35.995001451 -0500 -+++ libglusterfs/src/Makefile.in 2011-11-23 14:31:01.730999353 -0500 -@@ -866,7 +866,8 @@ - $(LEX) -t $(srcdir)/graph.l > $@ - - y.tab.c y.tab.h: graph.y -- $(YACC) -d $(srcdir)/graph.y -+ $(YACC) -d -b foo $(srcdir)/graph.y -+ mv foo.tab.h y.tab.h && mv foo.tab.c y.tab.c - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. - .NOEXPORT: diff --git a/glusterfs-3.2.7.xlators.mgmt.glusterd.glusterd-rpc-ops.c.patch b/glusterfs-3.2.7.xlators.mgmt.glusterd.glusterd-rpc-ops.c.patch deleted file mode 100644 index d19799b..0000000 --- a/glusterfs-3.2.7.xlators.mgmt.glusterd.glusterd-rpc-ops.c.patch +++ /dev/null @@ -1,474 +0,0 @@ ---- xlators/mgmt/glusterd/src/glusterd-rpc-ops.c -+++ xlators/mgmt/glusterd/src/glusterd-rpc-ops.c -@@ -51,9 +51,26 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, - int32_t op_errno, rpcsvc_request_t *req, - void *op_ctx, char *op_errstr) - { -- int32_t ret = -1; -- gd_serialize_t sfunc = NULL; -- void *cli_rsp = NULL; -+ union { -+ gf1_cli_create_vol_rsp createv_rsp; -+ gf1_cli_start_vol_rsp startv_rsp; -+ gf1_cli_stop_vol_rsp stopv_rsp; -+ gf1_cli_delete_vol_rsp delv_rsp; -+ gf1_cli_defrag_vol_rsp defragv_rsp; -+ gf1_cli_set_vol_rsp setv_rsp; -+ gf1_cli_reset_vol_rsp resetv_rsp; -+ gf1_cli_sync_volume_rsp syncv_rsp; -+ gf1_cli_stats_volume_rsp statsv_rsp; -+ gf1_cli_add_brick_rsp addb_rsp; -+ gf1_cli_remove_brick_rsp rmb_rsp; -+ gf1_cli_replace_brick_rsp replb_rsp; -+ gf1_cli_log_filename_rsp logfn_rsp; -+ gf1_cli_log_rotate_rsp logrot_rsp; -+ gf1_cli_gsync_set_rsp gsyncs_rsp; -+ gf1_cli_quota_rsp quota_rsp; -+ } cli_rsp; -+ int32_t ret = -1; -+ gd_serialize_t sfunc = NULL; - dict_t *ctx = NULL; - char *free_ptr = NULL; - glusterd_conf_t *conf = NULL; -@@ -67,145 +84,103 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, - switch (op) { - case GD_OP_CREATE_VOLUME: - { -- gf1_cli_create_vol_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- rsp.volname = ""; -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- else -- rsp.op_errstr = ""; -- cli_rsp = &rsp; -+ cli_rsp.createv_rsp.op_ret = op_ret; -+ cli_rsp.createv_rsp.op_errno = op_errno; -+ cli_rsp.createv_rsp.volname = ""; -+ cli_rsp.createv_rsp.op_errstr = op_errstr ? op_errstr : ""; - sfunc = gf_xdr_serialize_cli_create_vol_rsp; - break; - } - - case GD_OP_START_VOLUME: - { -- gf1_cli_start_vol_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- rsp.volname = ""; -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- else -- rsp.op_errstr = ""; -- cli_rsp = &rsp; -+ cli_rsp.startv_rsp.op_ret = op_ret; -+ cli_rsp.startv_rsp.op_errno = op_errno; -+ cli_rsp.startv_rsp.volname = ""; -+ cli_rsp.startv_rsp.op_errstr = op_errstr ? op_errstr : ""; - sfunc = gf_xdr_serialize_cli_start_vol_rsp; - break; - } - - case GD_OP_STOP_VOLUME: - { -- gf1_cli_stop_vol_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- rsp.volname = ""; -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- else -- rsp.op_errstr = ""; -- cli_rsp = &rsp; -+ cli_rsp.stopv_rsp.op_ret = op_ret; -+ cli_rsp.stopv_rsp.op_errno = op_errno; -+ cli_rsp.stopv_rsp.volname = ""; -+ cli_rsp.stopv_rsp.op_errstr = op_errstr ? op_errstr : ""; - sfunc = gf_xdr_serialize_cli_stop_vol_rsp; - break; - } - - case GD_OP_DELETE_VOLUME: - { -- gf1_cli_delete_vol_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- rsp.volname = ""; -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- else -- rsp.op_errstr = ""; -- cli_rsp = &rsp; -+ cli_rsp.delv_rsp.op_ret = op_ret; -+ cli_rsp.delv_rsp.op_errno = op_errno; -+ cli_rsp.delv_rsp.volname = ""; -+ cli_rsp.delv_rsp.op_errstr = op_errstr ? op_errstr : ""; - sfunc = gf_xdr_serialize_cli_delete_vol_rsp; - break; - } - - case GD_OP_DEFRAG_VOLUME: - { -- gf1_cli_defrag_vol_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- //rsp.volname = ""; -- cli_rsp = &rsp; -+ cli_rsp.defragv_rsp.op_ret = op_ret; -+ cli_rsp.defragv_rsp.op_errno = op_errno; -+ //cli_rsp.defragv_rsp.volname = ""; - sfunc = gf_xdr_serialize_cli_defrag_vol_rsp; - break; - } - - case GD_OP_ADD_BRICK: - { -- gf1_cli_add_brick_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- rsp.volname = ""; -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- else -- rsp.op_errstr = ""; -- cli_rsp = &rsp; -+ cli_rsp.addb_rsp.op_ret = op_ret; -+ cli_rsp.addb_rsp.op_errno = op_errno; -+ cli_rsp.addb_rsp.volname = ""; -+ cli_rsp.addb_rsp.op_errstr = op_errstr ? op_errstr : ""; - sfunc = gf_xdr_serialize_cli_add_brick_rsp; - break; - } - - case GD_OP_REMOVE_BRICK: - { -- gf1_cli_remove_brick_rsp rsp = {0,}; - ctx = op_ctx; - if (ctx && -- dict_get_str (ctx, "errstr", &rsp.op_errstr)) -- rsp.op_errstr = ""; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- rsp.volname = ""; -- cli_rsp = &rsp; -+ dict_get_str (ctx, "errstr", &cli_rsp.rmb_rsp.op_errstr)) -+ cli_rsp.rmb_rsp.op_errstr = ""; -+ cli_rsp.rmb_rsp.op_ret = op_ret; -+ cli_rsp.rmb_rsp.op_errno = op_errno; -+ cli_rsp.rmb_rsp.volname = ""; - sfunc = gf_xdr_serialize_cli_remove_brick_rsp; - break; - } - - case GD_OP_REPLACE_BRICK: - { -- gf1_cli_replace_brick_rsp rsp = {0,}; - ctx = op_ctx; - if (ctx && -- dict_get_str (ctx, "status-reply", &rsp.status)) -- rsp.status = ""; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- else -- rsp.op_errstr = ""; -- rsp.volname = ""; -- cli_rsp = &rsp; -+ dict_get_str (ctx, "status-reply", &cli_rsp.replb_rsp.status)) -+ cli_rsp.replb_rsp.status = ""; -+ cli_rsp.replb_rsp.op_ret = op_ret; -+ cli_rsp.replb_rsp.op_errno = op_errno; -+ cli_rsp.replb_rsp.volname = ""; -+ cli_rsp.replb_rsp.op_errstr = op_errstr ? op_errstr : ""; - sfunc = gf_xdr_serialize_cli_replace_brick_rsp; - break; - } - - case GD_OP_SET_VOLUME: - { -- gf1_cli_set_vol_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- rsp.volname = ""; - ctx = op_ctx; -- -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- else -- rsp.op_errstr = ""; - if (ctx) { - ret = dict_allocate_and_serialize (ctx, -- &rsp.dict.dict_val, -- (size_t*)&rsp.dict.dict_len); -+ &cli_rsp.setv_rsp.dict.dict_val, -+ (size_t*)&cli_rsp.setv_rsp.dict.dict_len); - if (ret == 0) -- free_ptr = rsp.dict.dict_val; -+ free_ptr = cli_rsp.setv_rsp.dict.dict_val; - } -- -- cli_rsp = &rsp; -+ cli_rsp.setv_rsp.op_errno = op_errno; -+ cli_rsp.setv_rsp.volname = ""; -+ cli_rsp.setv_rsp.op_errstr = op_errstr ? op_errstr : ""; - sfunc = gf_xdr_serialize_cli_set_vol_rsp; - break; - } -@@ -213,55 +188,35 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, - case GD_OP_RESET_VOLUME: - { - gf_log ("", GF_LOG_DEBUG, "Return value to CLI"); -- gf1_cli_reset_vol_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = 1; -- rsp.volname = ""; -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- else -- rsp.op_errstr = "Error while resetting options"; -- cli_rsp = &rsp; -+ cli_rsp.resetv_rsp.op_ret = op_ret; -+ cli_rsp.resetv_rsp.op_errno = 1; -+ cli_rsp.resetv_rsp.volname = ""; -+ cli_rsp.resetv_rsp.op_errstr = op_errstr ? op_errstr : "Error while resetting options"; - sfunc = gf_xdr_serialize_cli_reset_vol_rsp; - break; - } - - case GD_OP_LOG_FILENAME: - { -- gf1_cli_log_filename_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- if (op_errstr) -- rsp.errstr = op_errstr; -- else -- rsp.errstr = ""; -- cli_rsp = &rsp; -+ cli_rsp.logfn_rsp.op_ret = op_ret; -+ cli_rsp.logfn_rsp.op_errno = op_errno; -+ cli_rsp.logfn_rsp.errstr = op_errstr ? op_errstr : ""; - sfunc = gf_xdr_serialize_cli_log_filename_rsp; - break; - } - case GD_OP_LOG_ROTATE: - { -- gf1_cli_log_rotate_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- if (op_errstr) -- rsp.errstr = op_errstr; -- else -- rsp.errstr = ""; -- cli_rsp = &rsp; -+ cli_rsp.logrot_rsp.op_ret = op_ret; -+ cli_rsp.logrot_rsp.op_errno = op_errno; -+ cli_rsp.logrot_rsp.errstr = op_errstr ? op_errstr : ""; - sfunc = gf_xdr_serialize_cli_log_rotate_rsp; - break; - } - case GD_OP_SYNC_VOLUME: - { -- gf1_cli_sync_volume_rsp rsp = {0,}; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- else -- rsp.op_errstr = ""; -- cli_rsp = &rsp; -+ cli_rsp.syncv_rsp.op_ret = op_ret; -+ cli_rsp.syncv_rsp.op_errno = op_errno; -+ cli_rsp.syncv_rsp.op_errstr = op_errstr ? op_errstr : ""; - sfunc = gf_xdr_from_cli_sync_volume_rsp; - break; - } -@@ -273,72 +228,56 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, - char *slave = NULL; - char *op_name = NULL; - char *subop = NULL; -- gf1_cli_gsync_set_rsp rsp = {0,}; - -+ cli_rsp.gsyncs_rsp.op_ret = op_ret; -+ cli_rsp.gsyncs_rsp.op_errno = op_errno; -+ cli_rsp.gsyncs_rsp.op_errstr = op_errstr ? op_errstr : ""; -+ cli_rsp.gsyncs_rsp.op_name = ""; -+ cli_rsp.gsyncs_rsp.subop = ""; -+ cli_rsp.gsyncs_rsp.master = ""; -+ cli_rsp.gsyncs_rsp.slave = ""; -+ cli_rsp.gsyncs_rsp.glusterd_workdir = conf->workdir; -+ cli_rsp.gsyncs_rsp.gsync_prefix = GSYNCD_PREFIX; - ctx = op_ctx; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- rsp.op_errstr = ""; -- rsp.op_name = ""; -- rsp.subop = ""; -- rsp.master = ""; -- rsp.slave = ""; -- rsp.glusterd_workdir = conf->workdir; -- rsp.gsync_prefix = GSYNCD_PREFIX; - if (ctx) { - ret = dict_get_str (ctx, "errstr", &str); - if (ret == 0) -- rsp.op_errstr = str; -+ cli_rsp.gsyncs_rsp.op_errstr = str; - ret = dict_get_int32 (ctx, "type", &type); - if (ret == 0) -- rsp.type = type; -+ cli_rsp.gsyncs_rsp.type = type; - ret = dict_get_str (ctx, "master", &master); - if (ret == 0) -- rsp.master = master; -+ cli_rsp.gsyncs_rsp.master = master; - - ret = dict_get_str (ctx, "slave", &slave); - if (ret == 0) -- rsp.slave = slave; -+ cli_rsp.gsyncs_rsp.slave = slave; - - if (type == GF_GSYNC_OPTION_TYPE_CONFIG) { - if (dict_get_str (ctx, "op_name", &op_name) == 0) -- rsp.op_name = op_name; -+ cli_rsp.gsyncs_rsp.op_name = op_name; - if (dict_get_str (ctx, "subop", &subop) == 0) -- rsp.subop = subop; -+ cli_rsp.gsyncs_rsp.subop = subop; - } - - ret = dict_allocate_and_serialize (ctx, -- &rsp.status_dict.status_dict_val, -- (size_t*)&rsp.status_dict.status_dict_len); -+ &cli_rsp.gsyncs_rsp.status_dict.status_dict_val, -+ (size_t*)&cli_rsp.gsyncs_rsp.status_dict.status_dict_len); - - if (ret == 0) -- free_ptr = rsp.status_dict.status_dict_val; -+ free_ptr = cli_rsp.gsyncs_rsp.status_dict.status_dict_val; - - } -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_gsync_set_rsp; - break; - } -- case GD_OP_RENAME_VOLUME: -- case GD_OP_START_BRICK: -- case GD_OP_STOP_BRICK: -- case GD_OP_LOG_LOCATE: -- { -- gf_log ("", GF_LOG_DEBUG, "not supported op %d", op); -- break; -- } - case GD_OP_PROFILE_VOLUME: - { -- gf1_cli_stats_volume_rsp rsp = {0,}; - int32_t count = 0; -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- if (op_errstr) -- rsp.op_errstr = op_errstr; -- else -- rsp.op_errstr = ""; -+ cli_rsp.statsv_rsp.op_ret = op_ret; -+ cli_rsp.statsv_rsp.op_errno = op_errno; -+ cli_rsp.statsv_rsp.op_errstr = op_errstr ? op_errstr : ""; - ctx = op_ctx; - if (dict_get_int32 (ctx, "count", &count)) { - ret = dict_set_int32 (ctx, "count", 0); -@@ -347,10 +286,9 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, - "to set brick count."); - } - dict_allocate_and_serialize (ctx, -- &rsp.stats_info.stats_info_val, -- (size_t*)&rsp.stats_info.stats_info_len); -- free_ptr = rsp.stats_info.stats_info_val; -- cli_rsp = &rsp; -+ &cli_rsp.statsv_rsp.stats_info.stats_info_val, -+ (size_t*)&cli_rsp.statsv_rsp.stats_info.stats_info_len); -+ free_ptr = cli_rsp.statsv_rsp.stats_info.stats_info_val; - sfunc = gf_xdr_from_cli_stats_volume_rsp; - break; - } -@@ -360,49 +298,56 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, - int32_t type; - char *str = NULL; - char *errstr = NULL; -- gf1_cli_quota_rsp rsp = {0,}; - -- rsp.op_ret = op_ret; -- rsp.op_errno = op_errno; -- rsp.volname = ""; -+ cli_rsp.quota_rsp.op_ret = op_ret; -+ cli_rsp.quota_rsp.op_errno = op_errno; -+ cli_rsp.quota_rsp.volname = ""; - - ctx = op_ctx; - - if (op_errstr) -- rsp.op_errstr = op_errstr; -+ cli_rsp.quota_rsp.op_errstr = op_errstr; - else { - ret = dict_get_str (ctx, "errstr", &errstr); - if (ret == 0) -- rsp.op_errstr = errstr; -+ cli_rsp.quota_rsp.op_errstr = errstr; - else -- rsp.op_errstr = ""; -+ cli_rsp.quota_rsp.op_errstr = ""; - } - -- rsp.limit_list = ""; -+ cli_rsp.quota_rsp.limit_list = ""; - - if (op_ret == 0 && ctx) { - ret = dict_get_str (ctx, "volname", &str); - if (ret == 0) -- rsp.volname = str; -+ cli_rsp.quota_rsp.volname = str; - - ret = dict_get_int32 (ctx, "type", &type); - if (ret == 0) -- rsp.type = type; -+ cli_rsp.quota_rsp.type = type; - else -- rsp.type = 0; -+ cli_rsp.quota_rsp.type = 0; - - if (type == GF_QUOTA_OPTION_TYPE_LIST) { - ret = dict_get_str (ctx,"limit_list", &str); - - if (ret == 0) -- rsp.limit_list = str; -+ cli_rsp.quota_rsp.limit_list = str; - } - } -- cli_rsp = &rsp; - sfunc = gf_xdr_serialize_cli_quota_rsp; - break; - } - -+ case GD_OP_RENAME_VOLUME: -+ case GD_OP_START_BRICK: -+ case GD_OP_STOP_BRICK: -+ case GD_OP_LOG_LOCATE: -+ { -+ gf_log ("", GF_LOG_DEBUG, "not supported op %d", op); -+ break; -+ } -+ - case GD_OP_NONE: - case GD_OP_MAX: - { -@@ -411,7 +356,7 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, - } - } - -- ret = glusterd_submit_reply (req, cli_rsp, NULL, 0, NULL, -+ ret = glusterd_submit_reply (req, &cli_rsp, NULL, 0, NULL, - sfunc); - - if (free_ptr) diff --git a/glusterfs-3.3.0.cli.cli-rpc-ops.c.patch b/glusterfs-3.3.0.cli.cli-rpc-ops.c.patch deleted file mode 100644 index 3d7ca10..0000000 --- a/glusterfs-3.3.0.cli.cli-rpc-ops.c.patch +++ /dev/null @@ -1,20 +0,0 @@ -*** cli/src/cli-rpc-ops.c.orig 2012-07-18 13:16:43.720998232 -0400 ---- cli/src/cli-rpc-ops.c 2012-07-18 13:19:52.463999495 -0400 -*************** -*** 5832,5838 **** - if (!time) { - cli_out ("%s", path); - } else { -! tm = localtime ((time_t*)(&time)); - strftime (timestr, sizeof (timestr), - "%Y-%m-%d %H:%M:%S", tm); - if (i ==0) { ---- 5832,5839 ---- - if (!time) { - cli_out ("%s", path); - } else { -! time_t hack = time; -! tm = localtime (&hack); - strftime (timestr, sizeof (timestr), - "%Y-%m-%d %H:%M:%S", tm); - if (i ==0) { diff --git a/glusterfs-3.3.0.libglusterfs.Makefile.patch b/glusterfs-3.3.0.libglusterfs.Makefile.patch deleted file mode 100644 index bd9bde7..0000000 --- a/glusterfs-3.3.0.libglusterfs.Makefile.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- libglusterfs/src/Makefile.am.orig 2012-05-17 12:30:57.000000000 -0400 -+++ libglusterfs/src/Makefile.am 2012-05-18 08:52:55.469998306 -0400 -@@ -44,7 +44,8 @@ - $(LEX) -t $(srcdir)/graph.l > $@ - - y.tab.h: graph.y -- $(YACC) -d $(srcdir)/graph.y -+ $(YACC) -d -b foo $(srcdir)/graph.y -+ mv foo.tab.h y.tab.h && mv foo.tab.c y.tab.c - - CLEANFILES = graph.lex.c y.tab.c y.tab.h - CONFIG_CLEAN_FILES = $(CONTRIB_BUILDDIR)/uuid/uuid_types.h ---- libglusterfs/src/Makefile.in.orig 2012-05-17 12:31:12.000000000 -0400 -+++ libglusterfs/src/Makefile.in 2012-05-18 09:02:31.108002281 -0400 -@@ -941,7 +941,8 @@ - $(LEX) -t $(srcdir)/graph.l > $@ - - y.tab.h: graph.y -- $(YACC) -d $(srcdir)/graph.y -+ $(YACC) -d -b foo $(srcdir)/graph.y -+ mv foo.tab.h y.tab.h && mv foo.tab.c y.tab.c - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. - .NOEXPORT: diff --git a/glusterfs-3.3.0.swift.patch b/glusterfs-3.3.0.swift.patch deleted file mode 100644 index 8ed5070..0000000 --- a/glusterfs-3.3.0.swift.patch +++ /dev/null @@ -1,797 +0,0 @@ -diff --git a/setup.py b/setup.py -index d195d34..b5b5ca2 100644 ---- a/setup.py -+++ b/setup.py -@@ -1,5 +1,6 @@ - #!/usr/bin/python - # Copyright (c) 2010-2012 OpenStack, LLC. -+# Copyright (c) 2011 Red Hat, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. -@@ -94,6 +95,7 @@ setup( - 'tempurl=swift.common.middleware.tempurl:filter_factory', - 'formpost=swift.common.middleware.formpost:filter_factory', - 'name_check=swift.common.middleware.name_check:filter_factory', -+ 'gluster=swift.common.middleware.gluster:filter_factory', - ], - }, - ) -diff --git a/swift/account/server.py b/swift/account/server.py -index 800b3c0..cb17970 100644 ---- a/swift/account/server.py -+++ b/swift/account/server.py -@@ -1,4 +1,5 @@ - # Copyright (c) 2010-2012 OpenStack, LLC. -+# Copyright (c) 2011 Red Hat, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. -@@ -31,7 +32,7 @@ import simplejson - - from swift.common.db import AccountBroker - from swift.common.utils import get_logger, get_param, hash_path, \ -- normalize_timestamp, split_path, storage_directory -+ normalize_timestamp, split_path, storage_directory, plugin_enabled - from swift.common.constraints import ACCOUNT_LISTING_LIMIT, \ - check_mount, check_float, check_utf8 - from swift.common.db_replicator import ReplicatorRpc -@@ -39,6 +40,8 @@ from swift.common.db_replicator import ReplicatorRpc - - DATADIR = 'accounts' - -+if plugin_enabled(): -+ from swift.plugins.DiskDir import DiskAccount - - class AccountController(object): - """WSGI controller for the account server.""" -@@ -52,8 +55,12 @@ class AccountController(object): - self.mount_check, logger=self.logger) - self.auto_create_account_prefix = \ - conf.get('auto_create_account_prefix') or '.' -+ self.fs_object = None - - def _get_account_broker(self, drive, part, account): -+ if self.fs_object: -+ return DiskAccount(self.root, account, self.fs_object); -+ - hsh = hash_path(account) - db_dir = storage_directory(DATADIR, part, hsh) - db_path = os.path.join(self.root, drive, db_dir, hsh + '.db') -@@ -121,9 +128,15 @@ class AccountController(object): - if broker.is_deleted(): - return HTTPConflict(request=req) - metadata = {} -- metadata.update((key, (value, timestamp)) -- for key, value in req.headers.iteritems() -- if key.lower().startswith('x-account-meta-')) -+ if not self.fs_object: -+ metadata.update((key, (value, timestamp)) -+ for key, value in req.headers.iteritems() -+ if key.lower().startswith('x-account-meta-')) -+ else: -+ metadata.update((key, value) -+ for key, value in req.headers.iteritems() -+ if key.lower().startswith('x-account-meta-')) -+ - if metadata: - broker.update_metadata(metadata) - if created: -@@ -153,6 +166,9 @@ class AccountController(object): - broker.stale_reads_ok = True - if broker.is_deleted(): - return HTTPNotFound(request=req) -+ if self.fs_object and not self.fs_object.object_only: -+ broker.list_containers_iter(None, None,None, -+ None, None) - info = broker.get_info() - headers = { - 'X-Account-Container-Count': info['container_count'], -@@ -164,9 +180,16 @@ class AccountController(object): - container_ts = broker.get_container_timestamp(container) - if container_ts is not None: - headers['X-Container-Timestamp'] = container_ts -- headers.update((key, value) -- for key, (value, timestamp) in broker.metadata.iteritems() -- if value != '') -+ if not self.fs_object: -+ headers.update((key, value) -+ for key, (value, timestamp) in broker.metadata.iteritems() -+ if value != '') -+ else: -+ headers.update((key, value) -+ for key, value in broker.metadata.iteritems() -+ if value != '') -+ -+ - return HTTPNoContent(request=req, headers=headers) - - def GET(self, req): -@@ -190,9 +213,15 @@ class AccountController(object): - 'X-Account-Bytes-Used': info['bytes_used'], - 'X-Timestamp': info['created_at'], - 'X-PUT-Timestamp': info['put_timestamp']} -- resp_headers.update((key, value) -- for key, (value, timestamp) in broker.metadata.iteritems() -- if value != '') -+ if not self.fs_object: -+ resp_headers.update((key, value) -+ for key, (value, timestamp) in broker.metadata.iteritems() -+ if value != '') -+ else: -+ resp_headers.update((key, value) -+ for key, value in broker.metadata.iteritems() -+ if value != '') -+ - try: - prefix = get_param(req, 'prefix') - delimiter = get_param(req, 'delimiter') -@@ -224,6 +253,7 @@ class AccountController(object): - content_type='text/plain', request=req) - account_list = broker.list_containers_iter(limit, marker, end_marker, - prefix, delimiter) -+ - if out_content_type == 'application/json': - json_pattern = ['"name":%s', '"count":%s', '"bytes":%s'] - json_pattern = '{' + ','.join(json_pattern) + '}' -@@ -298,15 +328,29 @@ class AccountController(object): - return HTTPNotFound(request=req) - timestamp = normalize_timestamp(req.headers['x-timestamp']) - metadata = {} -- metadata.update((key, (value, timestamp)) -- for key, value in req.headers.iteritems() -- if key.lower().startswith('x-account-meta-')) -+ if not self.fs_object: -+ metadata.update((key, (value, timestamp)) -+ for key, value in req.headers.iteritems() -+ if key.lower().startswith('x-account-meta-')) -+ else: -+ metadata.update((key, value) -+ for key, value in req.headers.iteritems() -+ if key.lower().startswith('x-account-meta-')) - if metadata: - broker.update_metadata(metadata) - return HTTPNoContent(request=req) - -+ def plugin(self, env): -+ if env.get('Gluster_enabled', False): -+ self.fs_object = env.get('fs_object') -+ self.root = env.get('root') -+ self.mount_check = False -+ else: -+ self.fs_object = None -+ - def __call__(self, env, start_response): - start_time = time.time() -+ self.plugin(env) - req = Request(env) - self.logger.txn_id = req.headers.get('x-trans-id', None) - if not check_utf8(req.path_info): -diff --git a/swift/common/middleware/gluster.py b/swift/common/middleware/gluster.py -new file mode 100644 -index 0000000..341285d ---- /dev/null -+++ b/swift/common/middleware/gluster.py -@@ -0,0 +1,55 @@ -+# Copyright (c) 2011 Red Hat, Inc. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -+# implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+ -+from swift.common.utils import get_logger, plugin_enabled -+from swift import plugins -+from ConfigParser import ConfigParser -+ -+class Gluster_plugin(object): -+ """ -+ Update the environment with keys that reflect Gluster_plugin enabled -+ """ -+ -+ def __init__(self, app, conf): -+ self.app = app -+ self.conf = conf -+ self.fs_name = 'Glusterfs' -+ self.logger = get_logger(conf, log_route='gluster') -+ -+ def __call__(self, env, start_response): -+ if not plugin_enabled(): -+ return self.app(env, start_response) -+ env['Gluster_enabled'] =True -+ fs_object = getattr(plugins, self.fs_name, False) -+ if not fs_object: -+ raise Exception('%s plugin not found', self.fs_name) -+ -+ env['fs_object'] = fs_object() -+ fs_conf = ConfigParser() -+ if fs_conf.read('/etc/swift/fs.conf'): -+ try: -+ env['root'] = fs_conf.get ('DEFAULT', 'mount_path') -+ except NoSectionError, NoOptionError: -+ self.logger.exception(_('ERROR mount_path not present')) -+ return self.app(env, start_response) -+ -+def filter_factory(global_conf, **local_conf): -+ """Returns a WSGI filter app for use with paste.deploy.""" -+ conf = global_conf.copy() -+ conf.update(local_conf) -+ -+ def gluster_filter(app): -+ return Gluster_plugin(app, conf) -+ return gluster_filter -diff --git a/swift/common/utils.py b/swift/common/utils.py -index 47edce8..03701ce 100644 ---- a/swift/common/utils.py -+++ b/swift/common/utils.py -@@ -1,4 +1,5 @@ - # Copyright (c) 2010-2012 OpenStack, LLC. -+# Copyright (c) 2011 Red Hat, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. -@@ -1138,3 +1139,11 @@ def streq_const_time(s1, s2): - for (a, b) in zip(s1, s2): - result |= ord(a) ^ ord(b) - return result == 0 -+ -+def plugin_enabled(): -+ swift_conf = ConfigParser() -+ swift_conf.read(os.path.join('/etc/swift', 'swift.conf')) -+ try: -+ return swift_conf.get('DEFAULT', 'Enable_plugin', 'no') in TRUE_VALUES -+ except NoOptionError, NoSectionError: -+ return False -diff --git a/swift/container/server.py b/swift/container/server.py -index 8a18cfd..93943a3 100644 ---- a/swift/container/server.py -+++ b/swift/container/server.py -@@ -1,4 +1,5 @@ - # Copyright (c) 2010-2012 OpenStack, LLC. -+# Copyright (c) 2011 Red Hat, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. -@@ -31,7 +32,8 @@ from webob.exc import HTTPAccepted, HTTPBadRequest, HTTPConflict, \ - - from swift.common.db import ContainerBroker - from swift.common.utils import get_logger, get_param, hash_path, \ -- normalize_timestamp, storage_directory, split_path, validate_sync_to -+ normalize_timestamp, storage_directory, split_path, validate_sync_to, \ -+ plugin_enabled - from swift.common.constraints import CONTAINER_LISTING_LIMIT, \ - check_mount, check_float, check_utf8 - from swift.common.bufferedhttp import http_connect -@@ -40,6 +42,9 @@ from swift.common.db_replicator import ReplicatorRpc - - DATADIR = 'containers' - -+if plugin_enabled(): -+ from swift.plugins.DiskDir import DiskDir -+ - - class ContainerController(object): - """WSGI Controller for the container server.""" -@@ -62,6 +67,7 @@ class ContainerController(object): - ContainerBroker, self.mount_check, logger=self.logger) - self.auto_create_account_prefix = \ - conf.get('auto_create_account_prefix') or '.' -+ self.fs_object = None - - def _get_container_broker(self, drive, part, account, container): - """ -@@ -73,6 +79,11 @@ class ContainerController(object): - :param container: container name - :returns: ContainerBroker object - """ -+ if self.fs_object: -+ return DiskDir(self.root, drive, part, account, -+ container, self.logger, -+ fs_object = self.fs_object) -+ - hsh = hash_path(account, container) - db_dir = storage_directory(DATADIR, part, hsh) - db_path = os.path.join(self.root, drive, db_dir, hsh + '.db') -@@ -211,10 +222,18 @@ class ContainerController(object): - if broker.is_deleted(): - return HTTPConflict(request=req) - metadata = {} -- metadata.update((key, (value, timestamp)) -- for key, value in req.headers.iteritems() -- if key.lower() in self.save_headers or -- key.lower().startswith('x-container-meta-')) -+ #Note: check the structure of req.headers -+ if not self.fs_object: -+ metadata.update((key, (value, timestamp)) -+ for key, value in req.headers.iteritems() -+ if key.lower() in self.save_headers or -+ key.lower().startswith('x-container-meta-')) -+ else: -+ metadata.update((key, value) -+ for key, value in req.headers.iteritems() -+ if key.lower() in self.save_headers or -+ key.lower().startswith('x-container-meta-')) -+ - if metadata: - if 'X-Container-Sync-To' in metadata: - if 'X-Container-Sync-To' not in broker.metadata or \ -@@ -222,6 +241,7 @@ class ContainerController(object): - broker.metadata['X-Container-Sync-To'][0]: - broker.set_x_container_sync_points(-1, -1) - broker.update_metadata(metadata) -+ - resp = self.account_update(req, account, container, broker) - if resp: - return resp -@@ -245,6 +265,11 @@ class ContainerController(object): - broker.stale_reads_ok = True - if broker.is_deleted(): - return HTTPNotFound(request=req) -+ -+ if self.fs_object and not self.fs_object.object_only: -+ broker.list_objects_iter(None, None, None, None, -+ None, None) -+ - info = broker.get_info() - headers = { - 'X-Container-Object-Count': info['object_count'], -@@ -252,10 +277,17 @@ class ContainerController(object): - 'X-Timestamp': info['created_at'], - 'X-PUT-Timestamp': info['put_timestamp'], - } -- headers.update((key, value) -- for key, (value, timestamp) in broker.metadata.iteritems() -- if value != '' and (key.lower() in self.save_headers or -- key.lower().startswith('x-container-meta-'))) -+ if not self.fs_object: -+ headers.update((key, value) -+ for key, (value, timestamp) in broker.metadata.iteritems() -+ if value != '' and (key.lower() in self.save_headers or -+ key.lower().startswith('x-container-meta-'))) -+ else: -+ headers.update((key, value) -+ for key, value in broker.metadata.iteritems() -+ if value != '' and (key.lower() in self.save_headers or -+ key.lower().startswith('x-container-meta-'))) -+ - return HTTPNoContent(request=req, headers=headers) - - def GET(self, req): -@@ -268,6 +300,7 @@ class ContainerController(object): - request=req) - if self.mount_check and not check_mount(self.root, drive): - return Response(status='507 %s is not mounted' % drive) -+ - broker = self._get_container_broker(drive, part, account, container) - broker.pending_timeout = 0.1 - broker.stale_reads_ok = True -@@ -280,10 +313,17 @@ class ContainerController(object): - 'X-Timestamp': info['created_at'], - 'X-PUT-Timestamp': info['put_timestamp'], - } -- resp_headers.update((key, value) -- for key, (value, timestamp) in broker.metadata.iteritems() -- if value != '' and (key.lower() in self.save_headers or -- key.lower().startswith('x-container-meta-'))) -+ if not self.fs_object: -+ resp_headers.update((key, value) -+ for key, (value, timestamp) in broker.metadata.iteritems() -+ if value != '' and (key.lower() in self.save_headers or -+ key.lower().startswith('x-container-meta-'))) -+ else: -+ resp_headers.update((key, value) -+ for key, value in broker.metadata.iteritems() -+ if value != '' and (key.lower() in self.save_headers or -+ key.lower().startswith('x-container-meta-'))) -+ - try: - path = get_param(req, 'path') - prefix = get_param(req, 'prefix') -@@ -414,10 +454,17 @@ class ContainerController(object): - return HTTPNotFound(request=req) - timestamp = normalize_timestamp(req.headers['x-timestamp']) - metadata = {} -- metadata.update((key, (value, timestamp)) -- for key, value in req.headers.iteritems() -- if key.lower() in self.save_headers or -- key.lower().startswith('x-container-meta-')) -+ if not self.fs_object: -+ metadata.update((key, (value, timestamp)) -+ for key, value in req.headers.iteritems() -+ if key.lower() in self.save_headers or -+ key.lower().startswith('x-container-meta-')) -+ else: -+ metadata.update((key, value) -+ for key, value in req.headers.iteritems() -+ if key.lower() in self.save_headers or -+ key.lower().startswith('x-container-meta-')) -+ - if metadata: - if 'X-Container-Sync-To' in metadata: - if 'X-Container-Sync-To' not in broker.metadata or \ -@@ -427,8 +474,19 @@ class ContainerController(object): - broker.update_metadata(metadata) - return HTTPNoContent(request=req) - -+ def plugin(self, env): -+ if env.get('Gluster_enabled', False): -+ self.fs_object = env.get('fs_object') -+ if not self.fs_object: -+ raise NoneTypeError -+ self.root = env.get('root') -+ self.mount_check = False -+ else: -+ self.fs_object = None -+ - def __call__(self, env, start_response): - start_time = time.time() -+ self.plugin(env) - req = Request(env) - self.logger.txn_id = req.headers.get('x-trans-id', None) - if not check_utf8(req.path_info): -diff --git a/swift/obj/server.py b/swift/obj/server.py -index 9cca16b..a45daff 100644 ---- a/swift/obj/server.py -+++ b/swift/obj/server.py -@@ -1,4 +1,5 @@ - # Copyright (c) 2010-2012 OpenStack, LLC. -+# Copyright (c) 2011 Red Hat, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. -@@ -26,6 +27,7 @@ from hashlib import md5 - from tempfile import mkstemp - from urllib import unquote - from contextlib import contextmanager -+from ConfigParser import ConfigParser - - from webob import Request, Response, UTC - from webob.exc import HTTPAccepted, HTTPBadRequest, HTTPCreated, \ -@@ -37,16 +39,23 @@ from eventlet import sleep, Timeout, tpool - - from swift.common.utils import mkdirs, normalize_timestamp, \ - storage_directory, hash_path, renamer, fallocate, \ -- split_path, drop_buffer_cache, get_logger, write_pickle -+ split_path, drop_buffer_cache, get_logger, write_pickle, \ -+ plugin_enabled - from swift.common.bufferedhttp import http_connect --from swift.common.constraints import check_object_creation, check_mount, \ -- check_float, check_utf8 -+if plugin_enabled(): -+ from swift.plugins.constraints import check_object_creation -+ from swift.plugins.utils import X_TYPE, X_OBJECT_TYPE, FILE, DIR, MARKER_DIR, \ -+ OBJECT, DIR_TYPE, FILE_TYPE -+else: -+ from swift.common.constraints import check_object_creation -+ -+from swift.common.constraints import check_mount, check_float, check_utf8 -+ - from swift.common.exceptions import ConnectionTimeout, DiskFileError, \ - DiskFileNotExist - from swift.obj.replicator import tpooled_get_hashes, invalidate_hash, \ - quarantine_renamer - -- - DATADIR = 'objects' - ASYNCDIR = 'async_pending' - PICKLE_PROTOCOL = 2 -@@ -339,6 +348,9 @@ class DiskFile(object): - raise - raise DiskFileNotExist('Data File does not exist.') - -+if plugin_enabled(): -+ from swift.plugins.DiskFile import Gluster_DiskFile -+ - - class ObjectController(object): - """Implements the WSGI application for the Swift Object Server.""" -@@ -377,6 +389,17 @@ class ObjectController(object): - 'expiring_objects' - self.expiring_objects_container_divisor = \ - int(conf.get('expiring_objects_container_divisor') or 86400) -+ self.fs_object = None -+ -+ def get_DiskFile_obj(self, path, device, partition, account, container, obj, -+ logger, keep_data_fp=False, disk_chunk_size=65536): -+ if self.fs_object: -+ return Gluster_DiskFile(path, device, partition, account, container, -+ obj, logger, keep_data_fp, -+ disk_chunk_size, fs_object = self.fs_object); -+ else: -+ return DiskFile(path, device, partition, account, container, -+ obj, logger, keep_data_fp, disk_chunk_size) - - def async_update(self, op, account, container, obj, host, partition, - contdevice, headers_out, objdevice): -@@ -493,7 +516,7 @@ class ObjectController(object): - content_type='text/plain') - if self.mount_check and not check_mount(self.devices, device): - return Response(status='507 %s is not mounted' % device) -- file = DiskFile(self.devices, device, partition, account, container, -+ file = self.get_DiskFile_obj(self.devices, device, partition, account, container, - obj, self.logger, disk_chunk_size=self.disk_chunk_size) - - if 'X-Delete-At' in file.metadata and \ -@@ -548,7 +571,7 @@ class ObjectController(object): - if new_delete_at and new_delete_at < time.time(): - return HTTPBadRequest(body='X-Delete-At in past', request=request, - content_type='text/plain') -- file = DiskFile(self.devices, device, partition, account, container, -+ file = self.get_DiskFile_obj(self.devices, device, partition, account, container, - obj, self.logger, disk_chunk_size=self.disk_chunk_size) - orig_timestamp = file.metadata.get('X-Timestamp') - upload_expiration = time.time() + self.max_upload_time -@@ -580,12 +603,29 @@ class ObjectController(object): - if 'etag' in request.headers and \ - request.headers['etag'].lower() != etag: - return HTTPUnprocessableEntity(request=request) -- metadata = { -- 'X-Timestamp': request.headers['x-timestamp'], -- 'Content-Type': request.headers['content-type'], -- 'ETag': etag, -- 'Content-Length': str(os.fstat(fd).st_size), -- } -+ content_type = request.headers['content-type'] -+ if self.fs_object and not content_type: -+ content_type = FILE_TYPE -+ if not self.fs_object: -+ metadata = { -+ 'X-Timestamp': request.headers['x-timestamp'], -+ 'Content-Type': request.headers['content-type'], -+ 'ETag': etag, -+ 'Content-Length': str(os.fstat(fd).st_size), -+ } -+ else: -+ metadata = { -+ 'X-Timestamp': request.headers['x-timestamp'], -+ 'Content-Type': request.headers['content-type'], -+ 'ETag': etag, -+ 'Content-Length': str(os.fstat(fd).st_size), -+ X_TYPE: OBJECT, -+ X_OBJECT_TYPE: FILE, -+ } -+ -+ if self.fs_object and \ -+ request.headers['content-type'].lower() == DIR_TYPE: -+ metadata.update({X_OBJECT_TYPE: MARKER_DIR}) - metadata.update(val for val in request.headers.iteritems() - if val[0].lower().startswith('x-object-meta-') and - len(val[0]) > 14) -@@ -612,7 +652,7 @@ class ObjectController(object): - 'x-timestamp': file.metadata['X-Timestamp'], - 'x-etag': file.metadata['ETag'], - 'x-trans-id': request.headers.get('x-trans-id', '-')}, -- device) -+ (self.fs_object and account) or device) - resp = HTTPCreated(request=request, etag=etag) - return resp - -@@ -626,9 +666,9 @@ class ObjectController(object): - content_type='text/plain') - if self.mount_check and not check_mount(self.devices, device): - return Response(status='507 %s is not mounted' % device) -- file = DiskFile(self.devices, device, partition, account, container, -- obj, self.logger, keep_data_fp=True, -- disk_chunk_size=self.disk_chunk_size) -+ file = self.get_DiskFile_obj(self.devices, device, partition, account, container, -+ obj, self.logger, keep_data_fp=True, -+ disk_chunk_size=self.disk_chunk_size) - if file.is_deleted() or ('X-Delete-At' in file.metadata and - int(file.metadata['X-Delete-At']) <= time.time()): - if request.headers.get('if-match') == '*': -@@ -702,7 +742,7 @@ class ObjectController(object): - return resp - if self.mount_check and not check_mount(self.devices, device): - return Response(status='507 %s is not mounted' % device) -- file = DiskFile(self.devices, device, partition, account, container, -+ file = self.get_DiskFile_obj(self.devices, device, partition, account, container, - obj, self.logger, disk_chunk_size=self.disk_chunk_size) - if file.is_deleted() or ('X-Delete-At' in file.metadata and - int(file.metadata['X-Delete-At']) <= time.time()): -@@ -744,7 +784,7 @@ class ObjectController(object): - if self.mount_check and not check_mount(self.devices, device): - return Response(status='507 %s is not mounted' % device) - response_class = HTTPNoContent -- file = DiskFile(self.devices, device, partition, account, container, -+ file = self.get_DiskFile_obj(self.devices, device, partition, account, container, - obj, self.logger, disk_chunk_size=self.disk_chunk_size) - if 'x-if-delete-at' in request.headers and \ - int(request.headers['x-if-delete-at']) != \ -@@ -797,9 +837,18 @@ class ObjectController(object): - raise hashes - return Response(body=pickle.dumps(hashes)) - -+ def plugin(self, env): -+ if env.get('Gluster_enabled', False): -+ self.fs_object = env.get('fs_object') -+ self.devices = env.get('root') -+ self.mount_check = False -+ else: -+ self.fs_object = None -+ - def __call__(self, env, start_response): - """WSGI Application entry point for the Swift Object Server.""" - start_time = time.time() -+ self.plugin(env) - req = Request(env) - self.logger.txn_id = req.headers.get('x-trans-id', None) - if not check_utf8(req.path_info): -diff --git a/swift/proxy/server.py b/swift/proxy/server.py -index 17613b8..d277d28 100644 ---- a/swift/proxy/server.py -+++ b/swift/proxy/server.py -@@ -1,4 +1,5 @@ - # Copyright (c) 2010-2012 OpenStack, LLC. -+# Copyright (c) 2011 Red Hat, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. -@@ -53,11 +54,20 @@ from webob import Request, Response - - from swift.common.ring import Ring - from swift.common.utils import cache_from_env, ContextPool, get_logger, \ -- get_remote_client, normalize_timestamp, split_path, TRUE_VALUES -+ get_remote_client, normalize_timestamp, split_path, TRUE_VALUES, \ -+ plugin_enabled - from swift.common.bufferedhttp import http_connect --from swift.common.constraints import check_metadata, check_object_creation, \ -- check_utf8, CONTAINER_LISTING_LIMIT, MAX_ACCOUNT_NAME_LENGTH, \ -- MAX_CONTAINER_NAME_LENGTH, MAX_FILE_SIZE -+ -+if plugin_enabled(): -+ from swift.plugins.constraints import check_object_creation, \ -+ MAX_ACCOUNT_NAME_LENGTH, MAX_CONTAINER_NAME_LENGTH, MAX_FILE_SIZE -+else: -+ from swift.common.constraints import check_object_creation, \ -+ MAX_ACCOUNT_NAME_LENGTH, MAX_CONTAINER_NAME_LENGTH, MAX_FILE_SIZE -+ -+from swift.common.constraints import check_metadata, check_utf8, \ -+ CONTAINER_LISTING_LIMIT -+ - from swift.common.exceptions import ChunkReadTimeout, \ - ChunkWriteTimeout, ConnectionTimeout - -diff --git a/test/__init__.py b/test/__init__.py -index ef2ce31..363a051 100644 ---- a/test/__init__.py -+++ b/test/__init__.py -@@ -6,8 +6,16 @@ import sys - import os - from ConfigParser import MissingSectionHeaderError - from StringIO import StringIO -- - from swift.common.utils import readconf -+from swift.common.utils import plugin_enabled -+if plugin_enabled(): -+ from swift.plugins.constraints import MAX_OBJECT_NAME_LENGTH, \ -+ MAX_CONTAINER_NAME_LENGTH, MAX_ACCOUNT_NAME_LENGTH, \ -+ MAX_FILE_SIZE -+else: -+ from swift.common.constraints import MAX_OBJECT_NAME_LENGTH, \ -+ MAX_CONTAINER_NAME_LENGTH, MAX_ACCOUNT_NAME_LENGTH, \ -+ MAX_FILE_SIZE - - setattr(__builtin__, '_', lambda x: x) - -diff --git a/test/functional/tests.py b/test/functional/tests.py -index b25b4fd..8d12f58 100644 ---- a/test/functional/tests.py -+++ b/test/functional/tests.py -@@ -31,6 +31,16 @@ import urllib - from test import get_config - from swift import Account, AuthenticationFailed, Connection, Container, \ - File, ResponseError -+from test import plugin_enabled -+if plugin_enabled(): -+ from test import MAX_OBJECT_NAME_LENGTH, \ -+ MAX_CONTAINER_NAME_LENGTH, MAX_ACCOUNT_NAME_LENGTH, \ -+ MAX_FILE_SIZE -+else: -+ from test import MAX_OBJECT_NAME_LENGTH, \ -+ MAX_CONTAINER_NAME_LENGTH, MAX_ACCOUNT_NAME_LENGTH, \ -+ MAX_FILE_SIZE -+ - - config = get_config() - -@@ -361,7 +371,7 @@ class TestContainer(Base): - set_up = False - - def testContainerNameLimit(self): -- limit = 256 -+ limit = MAX_CONTAINER_NAME_LENGTH - - for l in (limit-100, limit-10, limit-1, limit, - limit+1, limit+10, limit+100): -@@ -949,7 +959,7 @@ class TestFile(Base): - self.assert_status(404) - - def testNameLimit(self): -- limit = 1024 -+ limit = MAX_OBJECT_NAME_LENGTH - - for l in (1, 10, limit/2, limit-1, limit, limit+1, limit*2): - file = self.env.container.file('a'*l) -@@ -1093,7 +1103,7 @@ class TestFile(Base): - self.assert_(file.read(hdrs={'Range': r}) == data[0:1000]) - - def testFileSizeLimit(self): -- limit = 5*2**30 + 2 -+ limit = MAX_FILE_SIZE - tsecs = 3 - - for i in (limit-100, limit-10, limit-1, limit, limit+1, limit+10, -diff --git a/test/unit/obj/test_server.py b/test/unit/obj/test_server.py -index 075700e..5b6f32d 100644 ---- a/test/unit/obj/test_server.py -+++ b/test/unit/obj/test_server.py -@@ -1355,7 +1355,7 @@ class TestObjectController(unittest.TestCase): - - def test_max_object_name_length(self): - timestamp = normalize_timestamp(time()) -- req = Request.blank('/sda1/p/a/c/' + ('1' * 1024), -+ req = Request.blank('/sda1/p/a/c/' + ('1' * MAX_OBJECT_NAME_LENGTH), - environ={'REQUEST_METHOD': 'PUT'}, - headers={'X-Timestamp': timestamp, - 'Content-Length': '4', -diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py -index 364370e..c17fe59 100644 ---- a/test/unit/proxy/test_server.py -+++ b/test/unit/proxy/test_server.py -@@ -21,7 +21,6 @@ import os - import sys - import unittest - from nose import SkipTest --from ConfigParser import ConfigParser - from contextlib import contextmanager - from cStringIO import StringIO - from gzip import GzipFile -@@ -44,8 +43,18 @@ from swift.account import server as account_server - from swift.container import server as container_server - from swift.obj import server as object_server - from swift.common import ring --from swift.common.constraints import MAX_META_NAME_LENGTH, \ -- MAX_META_VALUE_LENGTH, MAX_META_COUNT, MAX_META_OVERALL_SIZE, MAX_FILE_SIZE -+from swift.common.utils import plugin_enabled -+if plugin_enabled(): -+ from swift.plugins.constraints import MAX_META_NAME_LENGTH, \ -+ MAX_META_VALUE_LENGTH, MAX_META_COUNT, MAX_META_OVERALL_SIZE, \ -+ MAX_FILE_SIZE, MAX_ACCOUNT_NAME_LENGTH, MAX_CONTAINER_NAME_LENGTH, \ -+ MAX_OBJECT_NAME_LENGTH -+else: -+ from swift.plugins.constraints import MAX_META_NAME_LENGTH, \ -+ MAX_META_VALUE_LENGTH, MAX_META_COUNT, MAX_META_OVERALL_SIZE, \ -+ MAX_FILE_SIZE, MAX_ACCOUNT_NAME_LENGTH, MAX_CONTAINER_NAME_LENGTH, \ -+ MAX_OBJECT_NAME_LENGTH -+ - from swift.common.utils import mkdirs, normalize_timestamp, NullLogger - from swift.common.wsgi import monkey_patch_mimetools - -@@ -3207,7 +3216,8 @@ class TestContainerController(unittest.TestCase): - def test_PUT_max_container_name_length(self): - with save_globals(): - controller = proxy_server.ContainerController(self.app, 'account', -- '1' * 256) -+ '1' * -+ MAX_CONTAINER_NAME_LENGTH,) - self.assert_status_map(controller.PUT, - (200, 200, 200, 201, 201, 201), 201, - missing_container=True) -@@ -3813,7 +3823,8 @@ class TestAccountController(unittest.TestCase): - def test_PUT_max_account_name_length(self): - with save_globals(): - self.app.allow_account_management = True -- controller = proxy_server.AccountController(self.app, '1' * 256) -+ controller = proxy_server.AccountController(self.app, '1' * -+ MAX_ACCOUNT_NAME_LENGTH) - self.assert_status_map(controller.PUT, (201, 201, 201), 201) - controller = proxy_server.AccountController(self.app, '2' * 257) - self.assert_status_map(controller.PUT, (201, 201, 201), 400) diff --git a/glusterfs-3.3.0.xlator.mount.fuse.fuse-bridge.c.patch b/glusterfs-3.3.0.xlator.mount.fuse.fuse-bridge.c.patch deleted file mode 100644 index 13fbb58..0000000 --- a/glusterfs-3.3.0.xlator.mount.fuse.fuse-bridge.c.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- xlators/mount/fuse/src/fuse-bridge.c.orig -+++ xlators/mount/fuse/src/fuse-bridge.c -@@ -4198,13 +4198,11 @@ fuse_thread_proc (void *data) - finh->uid == priv->uid_map_root) - finh->uid = 0; - --#ifdef GF_DARWIN_HOST_OS - if (finh->opcode >= FUSE_OP_HIGH) - /* turn down MacFUSE specific messages */ - fuse_enosys (this, finh, msg); - else --#endif -- fuse_ops[finh->opcode] (this, finh, msg); -+ fuse_ops[finh->opcode] (this, finh, msg); - - iobuf_unref (iobuf); - continue; -@@ -4423,40 +4421,47 @@ mem_acct_init (xlator_t *this) - - - static fuse_handler_t *fuse_std_ops[FUSE_OP_HIGH] = { -- [FUSE_INIT] = fuse_init, -- [FUSE_DESTROY] = fuse_destroy, - [FUSE_LOOKUP] = fuse_lookup, - [FUSE_FORGET] = fuse_forget, - [FUSE_GETATTR] = fuse_getattr, - [FUSE_SETATTR] = fuse_setattr, -- [FUSE_OPENDIR] = fuse_opendir, -- [FUSE_READDIR] = fuse_readdir, -- [FUSE_RELEASEDIR] = fuse_releasedir, -- [FUSE_ACCESS] = fuse_access, - [FUSE_READLINK] = fuse_readlink, -+ [FUSE_SYMLINK] = fuse_symlink, - [FUSE_MKNOD] = fuse_mknod, - [FUSE_MKDIR] = fuse_mkdir, - [FUSE_UNLINK] = fuse_unlink, - [FUSE_RMDIR] = fuse_rmdir, -- [FUSE_SYMLINK] = fuse_symlink, - [FUSE_RENAME] = fuse_rename, - [FUSE_LINK] = fuse_link, -- [FUSE_CREATE] = fuse_create, - [FUSE_OPEN] = fuse_open, - [FUSE_READ] = fuse_readv, - [FUSE_WRITE] = fuse_write, -- [FUSE_FLUSH] = fuse_flush, -+ [FUSE_STATFS] = fuse_statfs, - [FUSE_RELEASE] = fuse_release, - [FUSE_FSYNC] = fuse_fsync, -- [FUSE_FSYNCDIR] = fuse_fsyncdir, -- [FUSE_STATFS] = fuse_statfs, - [FUSE_SETXATTR] = fuse_setxattr, - [FUSE_GETXATTR] = fuse_getxattr, - [FUSE_LISTXATTR] = fuse_listxattr, - [FUSE_REMOVEXATTR] = fuse_removexattr, -+ [FUSE_FLUSH] = fuse_flush, -+ [FUSE_INIT] = fuse_init, -+ [FUSE_OPENDIR] = fuse_opendir, -+ [FUSE_READDIR] = fuse_readdir, -+ [FUSE_RELEASEDIR] = fuse_releasedir, -+ [FUSE_FSYNCDIR] = fuse_fsyncdir, - [FUSE_GETLK] = fuse_getlk, - [FUSE_SETLK] = fuse_setlk, - [FUSE_SETLKW] = fuse_setlk, -+ [FUSE_ACCESS] = fuse_access, -+ [FUSE_CREATE] = fuse_create, -+ /* [FUSE_INTERRUPT] */ -+ /* [FUSE_BMAP] */ -+ [FUSE_DESTROY] = fuse_destroy, -+ /* [FUSE_IOCTL] */ -+ /* [FUSE_POLL] */ -+ /* [FUSE_NOTIFY_REPLY] */ -+ /* [FUSE_BATCH_FORGET] */ -+ /* [FUSE_FALLOCATE] */ - }; - - diff --git a/glusterfs-3.3.1.rpc.rpcxprt.rdma.name.c.patch b/glusterfs-3.3.1.rpc.rpcxprt.rdma.name.c.patch deleted file mode 100644 index 67367ae..0000000 --- a/glusterfs-3.3.1.rpc.rpcxprt.rdma.name.c.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/rpc/rpc-transport/rdma/src/name.c 2012-10-11 13:38:22.000000000 -0400 -+++ b/rpc/rpc-transport/rdma/src/name.c 2013-04-12 13:50:07.000000000 -0400 -@@ -352,6 +352,8 @@ - if (listen_port_data) { - listen_port = data_to_uint16 (listen_port_data); - } else { -+ listen_port = GF_DEFAULT_RDMA_LISTEN_PORT; -+ - if (addr->sa_family == AF_INET6) { - struct sockaddr_in6 *in = (struct sockaddr_in6 *) addr; - in->sin6_addr = in6addr_any; diff --git a/glusterfs-3.3.1.swift.constraints.backport-1.7.4.patch b/glusterfs-3.3.1.swift.constraints.backport-1.7.4.patch deleted file mode 100644 index 78e3220..0000000 --- a/glusterfs-3.3.1.swift.constraints.backport-1.7.4.patch +++ /dev/null @@ -1,567 +0,0 @@ -From 9ce581c9c548c6a843e682f79f9ae510121501ac Mon Sep 17 00:00:00 2001 -From: Peter Portante -Date: Thu, 4 Oct 2012 11:32:56 -0400 -Subject: [PATCH] Backport commit a2ac5efaa64f57fbbe059066c6c4636dfd0715c2, - 'swift constraints are now settable via config', excluding - PEP8 changes that did not involve the constraints. - ---- - etc/swift.conf-sample | 73 ++++++++++++++++++++++++++++++++++ - swift/common/constraints.py | 29 +++++++++++++ - swift/container/sync.py | 8 +++- - test/functional/tests.py | 63 ++++++++++++++++++++++++----- - test/sample.conf | 15 +++++++ - test/unit/common/test_constraints.py | 9 +++- - test/unit/obj/test_server.py | 6 ++- - test/unit/proxy/test_server.py | 50 ++++++++++++++--------- - 8 files changed, 218 insertions(+), 35 deletions(-) - -diff --git a/etc/swift.conf-sample b/etc/swift.conf-sample -index 7e1c31d..2f4192a 100644 ---- a/etc/swift.conf-sample -+++ b/etc/swift.conf-sample -@@ -1,3 +1,76 @@ - [swift-hash] -+ -+# swift_hash_path_suffix is used as part of the hashing algorithm -+# when determining data placement in the cluster. This value should -+# remain secret and MUST NOT change once a cluster has been deployed. -+ - swift_hash_path_suffix = changeme - -+ -+ -+# The swift-constraints section sets the basic constraints on data -+# saved in the swift cluster. -+ -+[swift-constraints] -+ -+# max_file_size is the largest "normal" object that can be saved in -+# the cluster. This is also the limit on the size of each segment of -+# a "large" object when using the large object manifest support. -+# This value is set in bytes. Setting it to lower than 1MiB will cause -+# some tests to fail. It is STRONGLY recommended to leave this value at -+# the default (5 * 2**30 + 2). -+ -+#max_file_size = 5368709122 -+ -+ -+# max_meta_name_length is the max number of bytes in the utf8 encoding -+# of the name portion of a metadata header. -+ -+#max_meta_name_length = 128 -+ -+ -+# max_meta_value_length is the max number of bytes in the utf8 encoding -+# of a metadata value -+ -+#max_meta_value_length = 256 -+ -+ -+# max_meta_count is the max number of metadata keys that can be stored -+# on a single account, container, or object -+ -+#max_meta_count = 90 -+ -+ -+# max_meta_overall_size is the max number of bytes in the utf8 encoding -+# of the metadata (keys + values) -+ -+#max_meta_overall_size = 4096 -+ -+ -+# max_object_name_length is the max number of bytes in the utf8 encoding -+# of an object name -+ -+#max_object_name_length = 1024 -+ -+ -+# container_listing_limit is the default (and max) number of items -+# returned for a container listing request -+ -+#container_listing_limit = 10000 -+ -+ -+# account_listing_limit is the default (and max) number of items returned -+# for an account listing request -+#account_listing_limit = 10000 -+ -+ -+# max_account_name_length is the max number of bytes in the utf8 encoding -+# of an account name -+ -+#max_account_name_length = 256 -+ -+ -+# max_container_name_length is the max number of bytes in the utf8 encoding -+# of a container name -+ -+#max_container_name_length = 256 -diff --git a/swift/common/constraints.py b/swift/common/constraints.py -index a797b8b..0083346 100644 ---- a/swift/common/constraints.py -+++ b/swift/common/constraints.py -@@ -14,29 +14,58 @@ - # limitations under the License. - - import os -+from ConfigParser import ConfigParser, NoSectionError, NoOptionError, \ -+ RawConfigParser - - from webob.exc import HTTPBadRequest, HTTPLengthRequired, \ - HTTPRequestEntityTooLarge - -+constraints_conf = ConfigParser() -+constraints_conf.read('/etc/swift/swift.conf') -+ -+ -+def constraints_conf_int(name, default): -+ try: -+ return int(constraints_conf.get('swift-constraints', name)) -+ except (NoSectionError, NoOptionError): -+ return default -+ - - #: Max file size allowed for objects - MAX_FILE_SIZE = 5 * 1024 * 1024 * 1024 + 2 -+MAX_FILE_SIZE = constraints_conf_int('max_file_size', -+ 5368709122) # 5 * 1024 * 1024 * 1024 + 2 - #: Max length of the name of a key for metadata - MAX_META_NAME_LENGTH = 128 -+MAX_META_NAME_LENGTH = constraints_conf_int('max_meta_name_length', 128) - #: Max length of the value of a key for metadata - MAX_META_VALUE_LENGTH = 256 -+MAX_META_VALUE_LENGTH = constraints_conf_int('max_meta_value_length', 256) - #: Max number of metadata items - MAX_META_COUNT = 90 -+MAX_META_COUNT = constraints_conf_int('max_meta_count', 90) - #: Max overall size of metadata - MAX_META_OVERALL_SIZE = 4096 -+MAX_META_OVERALL_SIZE = constraints_conf_int('max_meta_overall_size', 4096) - #: Max object name length - MAX_OBJECT_NAME_LENGTH = 1024 -+MAX_OBJECT_NAME_LENGTH = constraints_conf_int('max_object_name_length', 1024) - #: Max object list length of a get request for a container - CONTAINER_LISTING_LIMIT = 10000 -+CONTAINER_LISTING_LIMIT = constraints_conf_int('container_listing_limit', -+ 10000) - #: Max container list length of a get request for an account - ACCOUNT_LISTING_LIMIT = 10000 - MAX_ACCOUNT_NAME_LENGTH = 256 - MAX_CONTAINER_NAME_LENGTH = 256 -+ACCOUNT_LISTING_LIMIT = constraints_conf_int('account_listing_limit', 10000) -+#: Max account name length -+MAX_ACCOUNT_NAME_LENGTH = constraints_conf_int('max_account_name_length', 256) -+#: Max container name length -+MAX_CONTAINER_NAME_LENGTH = constraints_conf_int('max_container_name_length', -+ 256) -+ -+ - #: Query string format= values to their corresponding content-type values - FORMAT2CONTENT_TYPE = {'plain': 'text/plain', 'json': 'application/json', - 'xml': 'application/xml'} -diff --git a/swift/container/sync.py b/swift/container/sync.py -index d7152ac..472d33a 100644 ---- a/swift/container/sync.py -+++ b/swift/container/sync.py -@@ -21,8 +21,12 @@ from eventlet import sleep, Timeout - - import swift.common.db - from swift.container import server as container_server --from swiftclient import ClientException, delete_object, put_object, \ -- quote -+try: -+ from swiftclient import ClientException, delete_object, put_object, \ -+ quote -+except: -+ import sys -+ raise Exception("\n".join(sys.path)) - from swift.common.direct_client import direct_get_object - from swift.common.ring import Ring - from swift.common.db import ContainerBroker -diff --git a/test/functional/tests.py b/test/functional/tests.py -index a412f83..bcdd76f 100644 ---- a/test/functional/tests.py -+++ b/test/functional/tests.py -@@ -15,6 +15,7 @@ - # limitations under the License. - - from datetime import datetime -+from ConfigParser import ConfigParser - import locale - import random - import StringIO -@@ -26,8 +27,50 @@ from nose import SkipTest - - from test import get_config - from test.functional.swift import Account, Connection, File, ResponseError -- -+from swift.common.constraints import MAX_FILE_SIZE, MAX_META_NAME_LENGTH, \ -+ MAX_META_VALUE_LENGTH, MAX_META_COUNT, MAX_META_OVERALL_SIZE, \ -+ MAX_OBJECT_NAME_LENGTH, CONTAINER_LISTING_LIMIT, ACCOUNT_LISTING_LIMIT, \ -+ MAX_ACCOUNT_NAME_LENGTH, MAX_CONTAINER_NAME_LENGTH -+ -+default_constraints = dict(( -+ ('max_file_size', MAX_FILE_SIZE), -+ ('max_meta_name_length', MAX_META_NAME_LENGTH), -+ ('max_meta_value_length', MAX_META_VALUE_LENGTH), -+ ('max_meta_count', MAX_META_COUNT), -+ ('max_meta_overall_size', MAX_META_OVERALL_SIZE), -+ ('max_object_name_length', MAX_OBJECT_NAME_LENGTH), -+ ('container_listing_limit', CONTAINER_LISTING_LIMIT), -+ ('account_listing_limit', ACCOUNT_LISTING_LIMIT), -+ ('max_account_name_length', MAX_ACCOUNT_NAME_LENGTH), -+ ('max_container_name_length', MAX_CONTAINER_NAME_LENGTH))) -+constraints_conf = ConfigParser() -+conf_exists = constraints_conf.read('/etc/swift/swift.conf') -+# Constraints are set first from the test config, then from -+# /etc/swift/swift.conf if it exists. If swift.conf doesn't exist, -+# then limit test coverage. This allows SAIO tests to work fine but -+# requires remote funtional testing to know something about the cluster -+# that is being tested. - config = get_config('func_test') -+for k in default_constraints: -+ if k in config: -+ # prefer what's in test.conf -+ config[k] = int(config[k]) -+ elif conf_exists: -+ # swift.conf exists, so use what's defined there (or swift defaults) -+ # This normally happens when the test is running locally to the cluster -+ # as in a SAIO. -+ config[k] = default_constraints[k] -+ else: -+ # .functests don't know what the constraints of the tested cluster are, -+ # so the tests can't reliably pass or fail. Therefore, skip those -+ # tests. -+ config[k] = '%s constraint is not defined' % k -+ -+def load_constraint(name): -+ c = config[name] -+ if not isinstance(c, int): -+ raise SkipTest(c) -+ return c - - locale.setlocale(locale.LC_COLLATE, config.get('collate', 'C')) - -@@ -225,8 +268,7 @@ class TestAccount(Base): - 'application/xml; charset=utf-8') - - def testListingLimit(self): -- limit = 10000 -- -+ limit = load_constraint('account_listing_limit') - for l in (1, 100, limit/2, limit-1, limit, limit+1, limit*2): - p = {'limit':l} - -@@ -353,7 +395,7 @@ class TestContainer(Base): - set_up = False - - def testContainerNameLimit(self): -- limit = 256 -+ limit = load_constraint('max_container_name_length') - - for l in (limit-100, limit-10, limit-1, limit, - limit+1, limit+10, limit+100): -@@ -398,6 +440,7 @@ class TestContainer(Base): - self.assert_(cont.files(parms={'prefix': f}) == [f]) - - def testPrefixAndLimit(self): -+ load_constraint('container_listing_limit') - cont = self.env.account.container(Utils.create_name()) - self.assert_(cont.create()) - -@@ -941,7 +984,7 @@ class TestFile(Base): - self.assert_status(404) - - def testNameLimit(self): -- limit = 1024 -+ limit = load_constraint('max_object_name_length') - - for l in (1, 10, limit/2, limit-1, limit, limit+1, limit*2): - file = self.env.container.file('a'*l) -@@ -989,13 +1032,12 @@ class TestFile(Base): - self.assert_status(400) - - def testMetadataNumberLimit(self): -- number_limit = 90 -+ number_limit = load_constraint('max_meta_count') -+ size_limit = load_constraint('max_meta_overall_size') - - for i in (number_limit-10, number_limit-1, number_limit, - number_limit+1, number_limit+10, number_limit+100): - -- size_limit = 4096 -- - j = size_limit/(i * 2) - - size = 0 -@@ -1096,7 +1138,7 @@ class TestFile(Base): - self.assert_(file.read(hdrs={'Range': r}) == data[0:1000]) - - def testFileSizeLimit(self): -- limit = 5*2**30 + 2 -+ limit = load_constraint('max_file_size') - tsecs = 3 - - for i in (limit-100, limit-10, limit-1, limit, limit+1, limit+10, -@@ -1150,7 +1192,8 @@ class TestFile(Base): - self.assert_status(200) - - def testMetadataLengthLimits(self): -- key_limit, value_limit = 128, 256 -+ key_limit = load_constraint('max_meta_name_length') -+ value_limit = load_constraint('max_meta_value_length') - lengths = [[key_limit, value_limit], [key_limit, value_limit+1], \ - [key_limit+1, value_limit], [key_limit, 0], \ - [key_limit, value_limit*10], [key_limit*10, value_limit]] -diff --git a/test/sample.conf b/test/sample.conf -index 7594c02..d3eced0 100644 ---- a/test/sample.conf -+++ b/test/sample.conf -@@ -19,6 +19,21 @@ password2 = testing2 - username3 = tester3 - password3 = testing3 - -+# Default constraints if not defined here, the test runner will try -+# to set them from /etc/swift/swift.conf. If that file isn't found, -+# the test runner will skip tests that depend on these values. -+# Note that the cluster must have "sane" values for the test suite to pass. -+#max_file_size = 5368709122 -+#max_meta_name_length = 128 -+#max_meta_value_length = 256 -+#max_meta_count = 90 -+#max_meta_overall_size = 4096 -+#max_object_name_length = 1024 -+#container_listing_limit = 10000 -+#account_listing_limit = 10000 -+#max_account_name_length = 256 -+#max_container_name_length = 256 -+ - collate = C - - [unit_test] -diff --git a/test/unit/common/test_constraints.py b/test/unit/common/test_constraints.py -index 37ed225..000a0b4 100644 ---- a/test/unit/common/test_constraints.py -+++ b/test/unit/common/test_constraints.py -@@ -84,8 +84,13 @@ class TestConstraints(unittest.TestCase): - x += 1 - self.assertEquals(constraints.check_metadata(Request.blank('/', - headers=headers), 'object'), None) -- headers['X-Object-Meta-9999%s' % -- ('a' * (constraints.MAX_META_NAME_LENGTH - 4))] = \ -+ # add two more headers in case adding just one falls exactly on the -+ # limit (eg one header adds 1024 and the limit is 2048) -+ headers['X-Object-Meta-%04d%s' % -+ (x, 'a' * (constraints.MAX_META_NAME_LENGTH - 4))] = \ -+ 'v' * constraints.MAX_META_VALUE_LENGTH -+ headers['X-Object-Meta-%04d%s' % -+ (x + 1, 'a' * (constraints.MAX_META_NAME_LENGTH - 4))] = \ - 'v' * constraints.MAX_META_VALUE_LENGTH - self.assert_(isinstance(constraints.check_metadata(Request.blank('/', - headers=headers), 'object'), HTTPBadRequest)) -diff --git a/test/unit/obj/test_server.py b/test/unit/obj/test_server.py -index 0d94dba..f78baa1 100644 ---- a/test/unit/obj/test_server.py -+++ b/test/unit/obj/test_server.py -@@ -35,6 +35,7 @@ from swift.common import utils - from swift.common.utils import hash_path, mkdirs, normalize_timestamp, \ - NullLogger, storage_directory - from swift.common.exceptions import DiskFileNotExist -+from swift.common import constraints - from eventlet import tpool - - -@@ -1389,7 +1390,8 @@ class TestObjectController(unittest.TestCase): - - def test_max_object_name_length(self): - timestamp = normalize_timestamp(time()) -- req = Request.blank('/sda1/p/a/c/' + ('1' * 1024), -+ max_name_len = constraints.MAX_OBJECT_NAME_LENGTH -+ req = Request.blank('/sda1/p/a/c/' + ('1' * max_name_len), - environ={'REQUEST_METHOD': 'PUT'}, - headers={'X-Timestamp': timestamp, - 'Content-Length': '4', -@@ -1397,7 +1399,7 @@ class TestObjectController(unittest.TestCase): - req.body = 'DATA' - resp = self.object_controller.PUT(req) - self.assertEquals(resp.status_int, 201) -- req = Request.blank('/sda1/p/a/c/' + ('2' * 1025), -+ req = Request.blank('/sda1/p/a/c/' + ('2' * (max_name_len + 1)), - environ={'REQUEST_METHOD': 'PUT'}, - headers={'X-Timestamp': timestamp, - 'Content-Length': '4', -diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py -index 80ef9f7..0e3f30d 100644 ---- a/test/unit/proxy/test_server.py -+++ b/test/unit/proxy/test_server.py -@@ -46,7 +46,8 @@ from swift.obj import server as object_server - from swift.common import ring - from swift.common.exceptions import ChunkReadTimeout - from swift.common.constraints import MAX_META_NAME_LENGTH, \ -- MAX_META_VALUE_LENGTH, MAX_META_COUNT, MAX_META_OVERALL_SIZE, MAX_FILE_SIZE -+ MAX_META_VALUE_LENGTH, MAX_META_COUNT, MAX_META_OVERALL_SIZE, \ -+ MAX_FILE_SIZE, MAX_ACCOUNT_NAME_LENGTH, MAX_CONTAINER_NAME_LENGTH - from swift.common.utils import mkdirs, normalize_timestamp, NullLogger - from swift.common.wsgi import monkey_patch_mimetools - from swift.proxy.controllers.obj import SegmentedIterable -@@ -1060,47 +1061,50 @@ class TestObjectController(unittest.TestCase): - - def test_POST_meta_val_len(self): - with save_globals(): -+ limit = MAX_META_VALUE_LENGTH - self.app.object_post_as_copy = False - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') - set_http_connect(200, 200, 202, 202, 202) - # acct cont obj obj obj - req = Request.blank('/a/c/o', {}, headers={ -- 'Content-Type': 'foo/bar', -- 'X-Object-Meta-Foo': 'x' * 256}) -+ 'Content-Type': 'foo/bar', -+ 'X-Object-Meta-Foo': 'x' * limit}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 202) - set_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers={ -- 'Content-Type': 'foo/bar', -- 'X-Object-Meta-Foo': 'x' * 257}) -+ 'Content-Type': 'foo/bar', -+ 'X-Object-Meta-Foo': 'x' * (limit + 1)}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 400) - - def test_POST_as_copy_meta_val_len(self): - with save_globals(): -+ limit = MAX_META_VALUE_LENGTH - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') - set_http_connect(200, 200, 200, 200, 200, 202, 202, 202) - # acct cont objc objc objc obj obj obj - req = Request.blank('/a/c/o', {}, headers={ -- 'Content-Type': 'foo/bar', -- 'X-Object-Meta-Foo': 'x' * 256}) -+ 'Content-Type': 'foo/bar', -+ 'X-Object-Meta-Foo': 'x' * limit}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 202) - set_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers={ -- 'Content-Type': 'foo/bar', -- 'X-Object-Meta-Foo': 'x' * 257}) -+ 'Content-Type': 'foo/bar', -+ 'X-Object-Meta-Foo': 'x' * (limit + 1)}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 400) - - def test_POST_meta_key_len(self): - with save_globals(): -+ limit = MAX_META_NAME_LENGTH - self.app.object_post_as_copy = False - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') -@@ -1108,44 +1112,46 @@ class TestObjectController(unittest.TestCase): - # acct cont obj obj obj - req = Request.blank('/a/c/o', {}, headers={ - 'Content-Type': 'foo/bar', -- ('X-Object-Meta-' + 'x' * 128): 'x'}) -+ ('X-Object-Meta-' + 'x' * limit): 'x'}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 202) - set_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers={ - 'Content-Type': 'foo/bar', -- ('X-Object-Meta-' + 'x' * 129): 'x'}) -+ ('X-Object-Meta-' + 'x' * (limit + 1)): 'x'}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 400) - - def test_POST_as_copy_meta_key_len(self): - with save_globals(): -+ limit = MAX_META_NAME_LENGTH - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') - set_http_connect(200, 200, 200, 200, 200, 202, 202, 202) - # acct cont objc objc objc obj obj obj - req = Request.blank('/a/c/o', {}, headers={ - 'Content-Type': 'foo/bar', -- ('X-Object-Meta-' + 'x' * 128): 'x'}) -+ ('X-Object-Meta-' + 'x' * limit): 'x'}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 202) - set_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers={ - 'Content-Type': 'foo/bar', -- ('X-Object-Meta-' + 'x' * 129): 'x'}) -+ ('X-Object-Meta-' + 'x' * (limit + 1)): 'x'}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 400) - - def test_POST_meta_count(self): - with save_globals(): -+ limit = MAX_META_COUNT - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') - headers = dict( -- (('X-Object-Meta-' + str(i), 'a') for i in xrange(91))) -+ (('X-Object-Meta-' + str(i), 'a') for i in xrange(limit + 1))) - headers.update({'Content-Type': 'foo/bar'}) - set_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers=headers) -@@ -1155,10 +1161,13 @@ class TestObjectController(unittest.TestCase): - - def test_POST_meta_size(self): - with save_globals(): -+ limit = MAX_META_OVERALL_SIZE - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') -+ count = limit / 256 # enough to cause the limit to be reched - headers = dict( -- (('X-Object-Meta-' + str(i), 'a' * 256) for i in xrange(1000))) -+ (('X-Object-Meta-' + str(i), 'a' * 256) -+ for i in xrange(count + 1))) - headers.update({'Content-Type': 'foo/bar'}) - set_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers=headers) -@@ -3408,13 +3417,14 @@ class TestContainerController(unittest.TestCase): - - def test_PUT_max_container_name_length(self): - with save_globals(): -+ limit = MAX_CONTAINER_NAME_LENGTH - controller = proxy_server.ContainerController(self.app, 'account', -- '1' * 256) -+ '1' * limit) - self.assert_status_map(controller.PUT, - (200, 200, 200, 201, 201, 201), 201, - missing_container=True) - controller = proxy_server.ContainerController(self.app, 'account', -- '2' * 257) -+ '2' * (limit + 1)) - self.assert_status_map(controller.PUT, (201, 201, 201), 400, - missing_container=True) - -@@ -3961,9 +3971,11 @@ class TestAccountController(unittest.TestCase): - def test_PUT_max_account_name_length(self): - with save_globals(): - self.app.allow_account_management = True -- controller = proxy_server.AccountController(self.app, '1' * 256) -+ limit = MAX_ACCOUNT_NAME_LENGTH -+ controller = proxy_server.AccountController(self.app, '1' * limit) - self.assert_status_map(controller.PUT, (201, 201, 201), 201) -- controller = proxy_server.AccountController(self.app, '2' * 257) -+ controller = proxy_server.AccountController( -+ self.app, '2' * (limit + 1)) - self.assert_status_map(controller.PUT, (201, 201, 201), 400) - - def test_PUT_connect_exceptions(self): --- -1.7.7.6 - diff --git a/glusterfs-3.3.1.swift.constraints.backport.patch b/glusterfs-3.3.1.swift.constraints.backport.patch deleted file mode 100644 index bb61a67..0000000 --- a/glusterfs-3.3.1.swift.constraints.backport.patch +++ /dev/null @@ -1,518 +0,0 @@ -From fc2421b04022ac6bbe9d5014362ec5f99f94c5e0 Mon Sep 17 00:00:00 2001 -From: Peter Portante -Date: Tue, 25 Sep 2012 13:27:59 -0400 -Subject: [PATCH] Backport commit a2ac5efaa64f57fbbe059066c6c4636dfd0715c2, - 'swift constraints are now settable via config', excluding - PEP8 changes that did not involve the constraints. - ---- - etc/swift.conf-sample | 73 ++++++++++++++++++++++++++++++++++ - swift/common/constraints.py | 37 ++++++++++++----- - test/functional/tests.py | 62 ++++++++++++++++++++++++---- - test/unit/common/test_constraints.py | 9 +++- - test/unit/obj/test_server.py | 7 ++- - test/unit/proxy/test_server.py | 50 ++++++++++++++--------- - 6 files changed, 196 insertions(+), 42 deletions(-) - -diff --git a/etc/swift.conf-sample b/etc/swift.conf-sample -index 7e1c31d..2f4192a 100644 ---- a/etc/swift.conf-sample -+++ b/etc/swift.conf-sample -@@ -1,3 +1,76 @@ - [swift-hash] -+ -+# swift_hash_path_suffix is used as part of the hashing algorithm -+# when determining data placement in the cluster. This value should -+# remain secret and MUST NOT change once a cluster has been deployed. -+ - swift_hash_path_suffix = changeme - -+ -+ -+# The swift-constraints section sets the basic constraints on data -+# saved in the swift cluster. -+ -+[swift-constraints] -+ -+# max_file_size is the largest "normal" object that can be saved in -+# the cluster. This is also the limit on the size of each segment of -+# a "large" object when using the large object manifest support. -+# This value is set in bytes. Setting it to lower than 1MiB will cause -+# some tests to fail. It is STRONGLY recommended to leave this value at -+# the default (5 * 2**30 + 2). -+ -+#max_file_size = 5368709122 -+ -+ -+# max_meta_name_length is the max number of bytes in the utf8 encoding -+# of the name portion of a metadata header. -+ -+#max_meta_name_length = 128 -+ -+ -+# max_meta_value_length is the max number of bytes in the utf8 encoding -+# of a metadata value -+ -+#max_meta_value_length = 256 -+ -+ -+# max_meta_count is the max number of metadata keys that can be stored -+# on a single account, container, or object -+ -+#max_meta_count = 90 -+ -+ -+# max_meta_overall_size is the max number of bytes in the utf8 encoding -+# of the metadata (keys + values) -+ -+#max_meta_overall_size = 4096 -+ -+ -+# max_object_name_length is the max number of bytes in the utf8 encoding -+# of an object name -+ -+#max_object_name_length = 1024 -+ -+ -+# container_listing_limit is the default (and max) number of items -+# returned for a container listing request -+ -+#container_listing_limit = 10000 -+ -+ -+# account_listing_limit is the default (and max) number of items returned -+# for an account listing request -+#account_listing_limit = 10000 -+ -+ -+# max_account_name_length is the max number of bytes in the utf8 encoding -+# of an account name -+ -+#max_account_name_length = 256 -+ -+ -+# max_container_name_length is the max number of bytes in the utf8 encoding -+# of a container name -+ -+#max_container_name_length = 256 -diff --git a/swift/common/constraints.py b/swift/common/constraints.py -index 235dcca..0fe5078 100644 ---- a/swift/common/constraints.py -+++ b/swift/common/constraints.py -@@ -14,29 +14,46 @@ - # limitations under the License. - - import os -+from ConfigParser import ConfigParser, NoSectionError, NoOptionError, \ -+ RawConfigParser - - from webob.exc import HTTPBadRequest, HTTPLengthRequired, \ - HTTPRequestEntityTooLarge - -+constraints_conf = ConfigParser() -+constraints_conf.read('/etc/swift/swift.conf') -+ -+ -+def constraints_conf_int(name, default): -+ try: -+ return int(constraints_conf.get('swift-constraints', name)) -+ except (NoSectionError, NoOptionError): -+ return default -+ - - #: Max file size allowed for objects --MAX_FILE_SIZE = 5 * 1024 * 1024 * 1024 + 2 -+MAX_FILE_SIZE = constraints_conf_int('max_file_size', -+ 5368709122) # 5 * 1024 * 1024 * 1024 + 2 - #: Max length of the name of a key for metadata --MAX_META_NAME_LENGTH = 128 -+MAX_META_NAME_LENGTH = constraints_conf_int('max_meta_name_length', 128) - #: Max length of the value of a key for metadata --MAX_META_VALUE_LENGTH = 256 -+MAX_META_VALUE_LENGTH = constraints_conf_int('max_meta_value_length', 256) - #: Max number of metadata items --MAX_META_COUNT = 90 -+MAX_META_COUNT = constraints_conf_int('max_meta_count', 90) - #: Max overall size of metadata --MAX_META_OVERALL_SIZE = 4096 -+MAX_META_OVERALL_SIZE = constraints_conf_int('max_meta_overall_size', 4096) - #: Max object name length --MAX_OBJECT_NAME_LENGTH = 1024 -+MAX_OBJECT_NAME_LENGTH = constraints_conf_int('max_object_name_length', 1024) - #: Max object list length of a get request for a container --CONTAINER_LISTING_LIMIT = 10000 -+CONTAINER_LISTING_LIMIT = constraints_conf_int('container_listing_limit', -+ 10000) - #: Max container list length of a get request for an account --ACCOUNT_LISTING_LIMIT = 10000 --MAX_ACCOUNT_NAME_LENGTH = 256 --MAX_CONTAINER_NAME_LENGTH = 256 -+ACCOUNT_LISTING_LIMIT = constraints_conf_int('account_listing_limit', 10000) -+#: Max account name length -+MAX_ACCOUNT_NAME_LENGTH = constraints_conf_int('max_account_name_length', 256) -+#: Max container name length -+MAX_CONTAINER_NAME_LENGTH = constraints_conf_int('max_container_name_length', -+ 256) - - - def check_metadata(req, target_type): -diff --git a/test/functional/tests.py b/test/functional/tests.py -index b25b4fd..3b18fc4 100644 ---- a/test/functional/tests.py -+++ b/test/functional/tests.py -@@ -27,12 +27,55 @@ import threading - import uuid - import unittest - import urllib -+from ConfigParser import ConfigParser - - from test import get_config - from swift import Account, AuthenticationFailed, Connection, Container, \ - File, ResponseError -- -+from swift.common.constraints import MAX_FILE_SIZE, MAX_META_NAME_LENGTH, \ -+ MAX_META_VALUE_LENGTH, MAX_META_COUNT, MAX_META_OVERALL_SIZE, \ -+ MAX_OBJECT_NAME_LENGTH, CONTAINER_LISTING_LIMIT, ACCOUNT_LISTING_LIMIT, \ -+ MAX_ACCOUNT_NAME_LENGTH, MAX_CONTAINER_NAME_LENGTH -+ -+default_constraints = dict(( -+ ('max_file_size', MAX_FILE_SIZE), -+ ('max_meta_name_length', MAX_META_NAME_LENGTH), -+ ('max_meta_value_length', MAX_META_VALUE_LENGTH), -+ ('max_meta_count', MAX_META_COUNT), -+ ('max_meta_overall_size', MAX_META_OVERALL_SIZE), -+ ('max_object_name_length', MAX_OBJECT_NAME_LENGTH), -+ ('container_listing_limit', CONTAINER_LISTING_LIMIT), -+ ('account_listing_limit', ACCOUNT_LISTING_LIMIT), -+ ('max_account_name_length', MAX_ACCOUNT_NAME_LENGTH), -+ ('max_container_name_length', MAX_CONTAINER_NAME_LENGTH))) -+constraints_conf = ConfigParser() -+conf_exists = constraints_conf.read('/etc/swift/swift.conf') -+# Constraints are set first from the test config, then from -+# /etc/swift/swift.conf if it exists. If swift.conf doesn't exist, -+# then limit test coverage. This allows SAIO tests to work fine but -+# requires remote funtional testing to know something about the cluster -+# that is being tested. - config = get_config() -+for k in default_constraints: -+ if k in config: -+ # prefer what's in test.conf -+ config[k] = int(config[k]) -+ elif conf_exists: -+ # swift.conf exists, so use what's defined there (or swift defaults) -+ # This normally happens when the test is running locally to the cluster -+ # as in a SAIO. -+ config[k] = default_constraints[k] -+ else: -+ # .functests don't know what the constraints of the tested cluster are, -+ # so the tests can't reliably pass or fail. Therefore, skip those -+ # tests. -+ config[k] = '%s constraint is not defined' % k -+ -+def load_constraint(name): -+ c = config[name] -+ if not isinstance(c, int): -+ raise SkipTest(c) -+ return c - - locale.setlocale(locale.LC_COLLATE, config.get('collate', 'C')) - -@@ -233,7 +276,7 @@ class TestAccount(Base): - 'application/xml; charset=utf-8') - - def testListingLimit(self): -- limit = 10000 -+ limit = load_constraint('account_listing_limit') - - for l in (1, 100, limit/2, limit-1, limit, limit+1, limit*2): - p = {'limit':l} -@@ -361,7 +404,7 @@ class TestContainer(Base): - set_up = False - - def testContainerNameLimit(self): -- limit = 256 -+ limit = load_constraint('max_container_name_length') - - for l in (limit-100, limit-10, limit-1, limit, - limit+1, limit+10, limit+100): -@@ -406,6 +449,7 @@ class TestContainer(Base): - self.assert_(cont.files(parms={'prefix': f}) == [f]) - - def testPrefixAndLimit(self): -+ load_constraint('container_listing_limit') - cont = self.env.account.container(Utils.create_name()) - self.assert_(cont.create()) - -@@ -949,7 +993,7 @@ class TestFile(Base): - self.assert_status(404) - - def testNameLimit(self): -- limit = 1024 -+ limit = load_constraint('max_object_name_length') - - for l in (1, 10, limit/2, limit-1, limit, limit+1, limit*2): - file = self.env.container.file('a'*l) -@@ -997,13 +1041,12 @@ class TestFile(Base): - self.assert_status(400) - - def testMetadataNumberLimit(self): -- number_limit = 90 -+ number_limit = load_constraint('max_meta_count') -+ size_limit = load_constraint('max_meta_overall_size') - - for i in (number_limit-10, number_limit-1, number_limit, - number_limit+1, number_limit+10, number_limit+100): - -- size_limit = 4096 -- - j = size_limit/(i * 2) - - size = 0 -@@ -1093,7 +1136,7 @@ class TestFile(Base): - self.assert_(file.read(hdrs={'Range': r}) == data[0:1000]) - - def testFileSizeLimit(self): -- limit = 5*2**30 + 2 -+ limit = load_constraint('max_file_size') - tsecs = 3 - - for i in (limit-100, limit-10, limit-1, limit, limit+1, limit+10, -@@ -1147,7 +1190,8 @@ class TestFile(Base): - self.assert_status(200) - - def testMetadataLengthLimits(self): -- key_limit, value_limit = 128, 256 -+ key_limit = load_constraint('max_meta_name_length') -+ value_limit = load_constraint('max_meta_value_length') - lengths = [[key_limit, value_limit], [key_limit, value_limit+1], \ - [key_limit+1, value_limit], [key_limit, 0], \ - [key_limit, value_limit*10], [key_limit*10, value_limit]] -diff --git a/test/unit/common/test_constraints.py b/test/unit/common/test_constraints.py -index 478b2a8..4b0c997 100644 ---- a/test/unit/common/test_constraints.py -+++ b/test/unit/common/test_constraints.py -@@ -84,8 +84,13 @@ class TestConstraints(unittest.TestCase): - x += 1 - self.assertEquals(constraints.check_metadata(Request.blank('/', - headers=headers), 'object'), None) -- headers['X-Object-Meta-9999%s' % -- ('a' * (constraints.MAX_META_NAME_LENGTH - 4))] = \ -+ # add two more headers in case adding just one falls exactly on the -+ # limit (eg one header adds 1024 and the limit is 2048) -+ headers['X-Object-Meta-%04d%s' % -+ (x, 'a' * (constraints.MAX_META_NAME_LENGTH - 4))] = \ -+ 'v' * constraints.MAX_META_VALUE_LENGTH -+ headers['X-Object-Meta-%04d%s' % -+ (x + 1, 'a' * (constraints.MAX_META_NAME_LENGTH - 4))] = \ - 'v' * constraints.MAX_META_VALUE_LENGTH - self.assert_(isinstance(constraints.check_metadata(Request.blank('/', - headers=headers), 'object'), HTTPBadRequest)) -diff --git a/test/unit/obj/test_server.py b/test/unit/obj/test_server.py -index 075700e..5160830 100644 ---- a/test/unit/obj/test_server.py -+++ b/test/unit/obj/test_server.py -@@ -38,6 +38,7 @@ from swift.common import utils - from swift.common.utils import hash_path, mkdirs, normalize_timestamp, \ - NullLogger, storage_directory - from swift.common.exceptions import DiskFileNotExist -+from swift.common import constraints - from swift.obj import replicator - from eventlet import tpool - -@@ -1355,7 +1356,9 @@ class TestObjectController(unittest.TestCase): - - def test_max_object_name_length(self): - timestamp = normalize_timestamp(time()) -- req = Request.blank('/sda1/p/a/c/' + ('1' * 1024), -+ max_name_len = constraints.MAX_OBJECT_NAME_LENGTH -+ req = Request.blank('/sda1/p/a/c/' + ('1' * max_name_len), -+ - environ={'REQUEST_METHOD': 'PUT'}, - headers={'X-Timestamp': timestamp, - 'Content-Length': '4', -@@ -1363,7 +1366,7 @@ class TestObjectController(unittest.TestCase): - req.body = 'DATA' - resp = self.object_controller.PUT(req) - self.assertEquals(resp.status_int, 201) -- req = Request.blank('/sda1/p/a/c/' + ('2' * 1025), -+ req = Request.blank('/sda1/p/a/c/' + ('2' * (max_name_len + 1)), - environ={'REQUEST_METHOD': 'PUT'}, - headers={'X-Timestamp': timestamp, - 'Content-Length': '4', -diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py -index 364370e..d28f604 100644 ---- a/test/unit/proxy/test_server.py -+++ b/test/unit/proxy/test_server.py -@@ -45,7 +45,8 @@ from swift.container import server as container_server - from swift.obj import server as object_server - from swift.common import ring - from swift.common.constraints import MAX_META_NAME_LENGTH, \ -- MAX_META_VALUE_LENGTH, MAX_META_COUNT, MAX_META_OVERALL_SIZE, MAX_FILE_SIZE -+ MAX_META_VALUE_LENGTH, MAX_META_COUNT, MAX_META_OVERALL_SIZE, \ -+ MAX_FILE_SIZE, MAX_ACCOUNT_NAME_LENGTH, MAX_CONTAINER_NAME_LENGTH - from swift.common.utils import mkdirs, normalize_timestamp, NullLogger - from swift.common.wsgi import monkey_patch_mimetools - -@@ -1168,6 +1169,7 @@ class TestObjectController(unittest.TestCase): - - def test_POST_meta_val_len(self): - with save_globals(): -+ limit = MAX_META_VALUE_LENGTH - self.app.object_post_as_copy = False - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') -@@ -1175,42 +1177,44 @@ class TestObjectController(unittest.TestCase): - fake_http_connect(200, 200, 202, 202, 202) - # acct cont obj obj obj - req = Request.blank('/a/c/o', {}, headers={ -- 'Content-Type': 'foo/bar', -- 'X-Object-Meta-Foo': 'x' * 256}) -+ 'Content-Type': 'foo/bar', -+ 'X-Object-Meta-Foo': 'x' * limit}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 202) - proxy_server.http_connect = fake_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers={ -- 'Content-Type': 'foo/bar', -- 'X-Object-Meta-Foo': 'x' * 257}) -+ 'Content-Type': 'foo/bar', -+ 'X-Object-Meta-Foo': 'x' * (limit + 1)}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 400) - - def test_POST_as_copy_meta_val_len(self): - with save_globals(): -+ limit = MAX_META_VALUE_LENGTH - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') - proxy_server.http_connect = \ - fake_http_connect(200, 200, 200, 200, 200, 202, 202, 202) - # acct cont objc objc objc obj obj obj - req = Request.blank('/a/c/o', {}, headers={ -- 'Content-Type': 'foo/bar', -- 'X-Object-Meta-Foo': 'x' * 256}) -+ 'Content-Type': 'foo/bar', -+ 'X-Object-Meta-Foo': 'x' * limit}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 202) - proxy_server.http_connect = fake_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers={ -- 'Content-Type': 'foo/bar', -- 'X-Object-Meta-Foo': 'x' * 257}) -+ 'Content-Type': 'foo/bar', -+ 'X-Object-Meta-Foo': 'x' * (limit + 1)}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 400) - - def test_POST_meta_key_len(self): - with save_globals(): -+ limit = MAX_META_NAME_LENGTH - self.app.object_post_as_copy = False - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') -@@ -1219,20 +1223,21 @@ class TestObjectController(unittest.TestCase): - # acct cont obj obj obj - req = Request.blank('/a/c/o', {}, headers={ - 'Content-Type': 'foo/bar', -- ('X-Object-Meta-' + 'x' * 128): 'x'}) -+ ('X-Object-Meta-' + 'x' * limit): 'x'}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 202) - proxy_server.http_connect = fake_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers={ - 'Content-Type': 'foo/bar', -- ('X-Object-Meta-' + 'x' * 129): 'x'}) -+ ('X-Object-Meta-' + 'x' * (limit + 1)): 'x'}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 400) - - def test_POST_as_copy_meta_key_len(self): - with save_globals(): -+ limit = MAX_META_NAME_LENGTH - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') - proxy_server.http_connect = \ -@@ -1240,24 +1245,25 @@ class TestObjectController(unittest.TestCase): - # acct cont objc objc objc obj obj obj - req = Request.blank('/a/c/o', {}, headers={ - 'Content-Type': 'foo/bar', -- ('X-Object-Meta-' + 'x' * 128): 'x'}) -+ ('X-Object-Meta-' + 'x' * limit): 'x'}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 202) - proxy_server.http_connect = fake_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers={ - 'Content-Type': 'foo/bar', -- ('X-Object-Meta-' + 'x' * 129): 'x'}) -+ ('X-Object-Meta-' + 'x' * (limit + 1)): 'x'}) - self.app.update_request(req) - res = controller.POST(req) - self.assertEquals(res.status_int, 400) - - def test_POST_meta_count(self): - with save_globals(): -+ limit = MAX_META_COUNT - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') - headers = dict( -- (('X-Object-Meta-' + str(i), 'a') for i in xrange(91))) -+ (('X-Object-Meta-' + str(i), 'a') for i in xrange(limit + 1))) - headers.update({'Content-Type': 'foo/bar'}) - proxy_server.http_connect = fake_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers=headers) -@@ -1267,10 +1273,13 @@ class TestObjectController(unittest.TestCase): - - def test_POST_meta_size(self): - with save_globals(): -+ limit = MAX_META_OVERALL_SIZE - controller = proxy_server.ObjectController(self.app, 'account', - 'container', 'object') -+ count = limit / 256 # enough to cause the limit to be reched - headers = dict( -- (('X-Object-Meta-' + str(i), 'a' * 256) for i in xrange(1000))) -+ (('X-Object-Meta-' + str(i), 'a' * 256) -+ for i in xrange(count + 1))) - headers.update({'Content-Type': 'foo/bar'}) - proxy_server.http_connect = fake_http_connect(202, 202, 202) - req = Request.blank('/a/c/o', {}, headers=headers) -@@ -3206,13 +3215,14 @@ class TestContainerController(unittest.TestCase): - - def test_PUT_max_container_name_length(self): - with save_globals(): -+ limit = MAX_CONTAINER_NAME_LENGTH - controller = proxy_server.ContainerController(self.app, 'account', -- '1' * 256) -+ '1' * limit) - self.assert_status_map(controller.PUT, - (200, 200, 200, 201, 201, 201), 201, - missing_container=True) - controller = proxy_server.ContainerController(self.app, 'account', -- '2' * 257) -+ '2' * (limit + 1)) - self.assert_status_map(controller.PUT, (201, 201, 201), 400, - missing_container=True) - -@@ -3813,9 +3823,11 @@ class TestAccountController(unittest.TestCase): - def test_PUT_max_account_name_length(self): - with save_globals(): - self.app.allow_account_management = True -- controller = proxy_server.AccountController(self.app, '1' * 256) -+ limit = MAX_ACCOUNT_NAME_LENGTH -+ controller = proxy_server.AccountController(self.app, '1' * limit) - self.assert_status_map(controller.PUT, (201, 201, 201), 201) -- controller = proxy_server.AccountController(self.app, '2' * 257) -+ controller = proxy_server.AccountController( -+ self.app, '2' * (limit + 1)) - self.assert_status_map(controller.PUT, (201, 201, 201), 400) - - def test_PUT_connect_exceptions(self): --- -1.7.7.6 - diff --git a/glusterfs-3.3.1.ufo.gluster.multi-volume.backport-1.1.patch b/glusterfs-3.3.1.ufo.gluster.multi-volume.backport-1.1.patch deleted file mode 100644 index 6d7830b..0000000 --- a/glusterfs-3.3.1.ufo.gluster.multi-volume.backport-1.1.patch +++ /dev/null @@ -1,406 +0,0 @@ -diff -ru a/ufo/bin/gluster-swift-gen-builders b/ufo/bin/gluster-swift-gen-builders ---- a/ufo/bin/gluster-swift-gen-builders 2012-12-07 12:24:00.000000000 -0500 -+++ b/ufo/bin/gluster-swift-gen-builders 2013-04-29 15:16:22.748000000 -0400 -@@ -1,9 +1,25 @@ - #!/bin/bash - -+# Note that these port numbers must match the configured values for the -+# various servers in their configuration files. -+declare -A port=(["account.builder"]=6012 ["container.builder"]=6011 \ -+ ["object.builder"]=6010) -+ -+builder_files="account.builder container.builder object.builder" -+ - function create { -- swift-ring-builder $1 create 0 1 1 -- swift-ring-builder $1 add z1-127.0.0.1:$2/$3_ 100.0 -+ swift-ring-builder $1 create 1 1 1 >> /tmp/out -+} -+ -+function add { -+ swift-ring-builder $1 add z$2-127.0.0.1:$3/$4_ 100.0 -+} -+ -+function rebalance { - swift-ring-builder $1 rebalance -+} -+ -+function build { - swift-ring-builder $1 - } - -@@ -12,8 +28,17 @@ - exit 1 - fi - --# Note that these port numbers must match the configured values for the --# various servers in their configuration files. --create account.builder 6012 $1 --create container.builder 6011 $1 --create object.builder 6010 $1 -+for builder_file in $builder_files -+do -+ create $builder_file -+ -+ zone=1 -+ for volname in $@ -+ do -+ add $builder_file $zone ${port[$builder_file]} $volname -+ zone=$(expr $zone + 1) -+ done -+ -+ rebalance $builder_file -+ build $builder_file -+done -diff -ru a/ufo/etc/fs.conf-gluster b/ufo/etc/fs.conf-gluster ---- a/ufo/etc/fs.conf-gluster 2012-12-07 12:24:00.000000000 -0500 -+++ b/ufo/etc/fs.conf-gluster 2013-04-29 15:16:22.752000000 -0400 -@@ -3,10 +3,6 @@ - # local host. - mount_ip = localhost - --# The GlusterFS server need not be local, a remote server can also be used --# by setting "remote_cluster = yes". --remote_cluster = no -- - # By default it is assumed the Gluster volumes can be accessed using other - # methods besides UFO (not object only), which disables a caching - # optimizations in order to keep in sync with file system changes. -diff -ru a/ufo/gluster/swift/common/constraints.py b/ufo/gluster/swift/common/constraints.py ---- a/ufo/gluster/swift/common/constraints.py 2012-12-07 12:24:00.000000000 -0500 -+++ b/ufo/gluster/swift/common/constraints.py 2013-04-29 15:16:22.749000000 -0400 -@@ -16,7 +16,8 @@ - from webob.exc import HTTPBadRequest - - import swift.common.constraints --from gluster.swift.common import Glusterfs -+import swift.common.ring as _ring -+from gluster.swift.common import Glusterfs, ring - - - MAX_OBJECT_NAME_COMPONENT_LENGTH = swift.common.constraints.constraints_conf_int( -@@ -80,3 +81,9 @@ - - # Replace the original check mount with ours - swift.common.constraints.check_mount = gluster_check_mount -+ -+# Save the original Ring class -+__Ring = _ring.Ring -+ -+# Replace the original Ring class -+_ring.Ring = ring.Ring -diff -ru a/ufo/gluster/swift/common/Glusterfs.py b/ufo/gluster/swift/common/Glusterfs.py ---- a/ufo/gluster/swift/common/Glusterfs.py 2012-12-07 12:24:00.000000000 -0500 -+++ b/ufo/gluster/swift/common/Glusterfs.py 2013-04-29 15:16:22.753000000 -0400 -@@ -12,33 +12,35 @@ - # implied. - # See the License for the specific language governing permissions and - # limitations under the License. -+ - import logging - import os, fcntl, time --from ConfigParser import ConfigParser --from swift.common.utils import TRUE_VALUES -+from ConfigParser import ConfigParser, NoSectionError, NoOptionError -+from swift.common.utils import TRUE_VALUES, search_tree - from gluster.swift.common.fs_utils import mkdirs - -- - # - # Read the fs.conf file once at startup (module load) - # - _fs_conf = ConfigParser() - MOUNT_IP = 'localhost' --REMOTE_CLUSTER = False - OBJECT_ONLY = False -+RUN_DIR='/var/run/swift' -+SWIFT_DIR = '/etc/swift' - if _fs_conf.read(os.path.join('/etc/swift', 'fs.conf')): - try: - MOUNT_IP = _fs_conf.get('DEFAULT', 'mount_ip', 'localhost') - except (NoSectionError, NoOptionError): - pass - try: -- REMOTE_CLUSTER = _fs_conf.get('DEFAULT', 'remote_cluster', False) in TRUE_VALUES -+ OBJECT_ONLY = _fs_conf.get('DEFAULT', 'object_only', "no") in TRUE_VALUES - except (NoSectionError, NoOptionError): - pass - try: -- OBJECT_ONLY = _fs_conf.get('DEFAULT', 'object_only', "no") in TRUE_VALUES -+ RUN_DIR = _fs_conf.get('DEFAULT', 'run_dir', '/var/run/swift') - except (NoSectionError, NoOptionError): - pass -+ - NAME = 'glusterfs' - - -@@ -60,7 +62,7 @@ - if drive == export: - break - else: -- logging.error('No export found in %r matching drive %s', el, drive) -+ logging.error('No export found in %r matching drive, %s', el, drive) - return False - - # NOTE: root is typically the default value of /mnt/gluster-object -@@ -68,13 +70,12 @@ - if not os.path.isdir(full_mount_path): - mkdirs(full_mount_path) - -- pid_dir = "/var/lib/glusterd/vols/%s/run/" % drive -- pid_file = os.path.join(pid_dir, 'swift.pid'); -+ lck_file = os.path.join(RUN_DIR, '%s.lock' %drive); - -- if not os.path.exists(pid_dir): -- mkdirs(pid_dir) -+ if not os.path.exists(RUN_DIR): -+ mkdirs(RUN_DIR) - -- fd = os.open(pid_file, os.O_CREAT|os.O_RDWR) -+ fd = os.open(lck_file, os.O_CREAT|os.O_RDWR) - with os.fdopen(fd, 'r+b') as f: - try: - fcntl.lockf(f, fcntl.LOCK_EX|fcntl.LOCK_NB) -@@ -100,19 +101,12 @@ - logging.error('Unable to unmount %s %s' % (full_mount_path, NAME)) - - def _get_export_list(): -- if REMOTE_CLUSTER: -- cmnd = 'gluster --remote-host=%s volume info' % MOUNT_IP -- else: -- cmnd = 'gluster volume info' -+ cmnd = 'gluster --remote-host=%s volume info' % MOUNT_IP - - export_list = [] - - if os.system(cmnd + ' >> /dev/null'): -- if REMOTE_CLUSTER: -- logging.error('Getting volume info failed for %s, make sure '\ -- 'gluster --remote-host=%s works', NAME, MOUNT_IP) -- else: -- logging.error('Getting volume info failed for %s', NAME) -+ logging.error('Getting volume info failed for %s', NAME) - else: - fp = os.popen(cmnd) - while True: -@@ -124,3 +118,20 @@ - export_list.append(item.split(':')[1].strip(' ')) - - return export_list -+ -+def get_mnt_point(vol_name, conf_dir=SWIFT_DIR, conf_file="object-server*"): -+ """Read the object-server's configuration file and return -+ the device value""" -+ -+ mnt_dir = '' -+ conf_files = search_tree(conf_dir, conf_file, '.conf') -+ if not conf_files: -+ raise Exception("Config file not found") -+ -+ _conf = ConfigParser() -+ if _conf.read(conf_files[0]): -+ try: -+ mnt_dir = _conf.get('DEFAULT', 'devices', '') -+ except (NoSectionError, NoOptionError): -+ raise -+ return os.path.join(mnt_dir, vol_name) -diff -ru a/ufo/gluster/swift/common/ring.py b/ufo/gluster/swift/common/ring.py ---- a/ufo/gluster/swift/common/ring.py 2013-04-30 08:21:55.948000000 -0400 -+++ b/ufo/gluster/swift/common/ring.py 2013-04-29 15:16:22.755000000 -0400 -@@ -0,0 +1,111 @@ -+# Copyright (c) 2013 Red Hat, Inc. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -+# implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+ -+from ConfigParser import ConfigParser -+from swift.common.ring import ring -+from swift.common.utils import search_tree -+from gluster.swift.common.Glusterfs import SWIFT_DIR -+ -+reseller_prefix = "AUTH_" -+conf_files = search_tree(SWIFT_DIR, "proxy-server*", 'conf') -+if conf_files: -+ conf_file = conf_files[0] -+ -+_conf = ConfigParser() -+if conf_files and _conf.read(conf_file): -+ if _conf.defaults().get("reseller_prefix", None): -+ reseller_prefix = _conf.defaults().get("reseller_prefix") -+ else: -+ for key, value in _conf._sections.items(): -+ if value.get("reseller_prefix", None): -+ reseller_prefix = value["reseller_prefix"] -+ break -+ -+if not reseller_prefix.endswith('_'): -+ reseller_prefix = reseller_prefix + '_' -+ -+class Ring(ring.Ring): -+ def _get_part_nodes(self, part): -+ seen_ids = set() -+ nodes = [dev for dev in self._devs \ -+ if dev['device'] == self.acc_name \ -+ and not (dev['id'] in seen_ids \ -+ or seen_ids.add(dev['id']))] -+ if not nodes: -+ nodes = [self.false_node] -+ return nodes -+ -+ def get_part_nodes(self, part): -+ """ -+ Get the nodes that are responsible for the partition. If one -+ node is responsible for more than one replica of the same -+ partition, it will only appear in the output once. -+ -+ :param part: partition to get nodes for -+ :returns: list of node dicts -+ -+ See :func:`get_nodes` for a description of the node dicts. -+ """ -+ return self._get_part_nodes(part) -+ -+ def get_nodes(self, account, container=None, obj=None): -+ """ -+ Get the partition and nodes for an account/container/object. -+ If a node is responsible for more than one replica, it will -+ only appear in the output once. -+ :param account: account name -+ :param container: container name -+ :param obj: object name -+ :returns: a tuple of (partition, list of node dicts) -+ -+ Each node dict will have at least the following keys: -+ ====== =============================================================== -+ id unique integer identifier amongst devices -+ weight a float of the relative weight of this device as compared to -+ others; this indicates how many partitions the builder will try -+ to assign to this device -+ zone integer indicating which zone the device is in; a given -+ partition will not be assigned to multiple devices within the -+ same zone -+ ip the ip address of the device -+ port the tcp port of the device -+ device the device's name on disk (sdb1, for example) -+ meta general use 'extra' field; for example: the online date, the -+ hardware description -+ ====== =============================================================== -+ """ -+ self.false_node = {'zone': 1, 'weight': 100.0, 'ip': '127.0.0.1', 'id': 0, \ -+ 'meta': '', 'device': 'volume_not_in_ring', \ -+ 'port': 6012} -+ if account.startswith(reseller_prefix): -+ self.acc_name = account.replace(reseller_prefix, '', 1) -+ else: -+ self.acc_name = account -+ -+ part = 0 -+ return part, self._get_part_nodes(part) -+ -+ -+ def get_more_nodes(self, part): -+ """ -+ Generator to get extra nodes for a partition for hinted handoff. -+ -+ :param part: partition to get handoff nodes for -+ :returns: generator of node dicts -+ -+ See :func:`get_nodes` for a description of the node dicts. -+ Should never be called in the swift UFO environment, so yield nothing -+ """ -+ yield self.false_node -diff -ru a/ufo/test/unit/common/test_ring.py b/ufo/test/unit/common/test_ring.py ---- a/ufo/test/unit/common/test_ring.py 2013-04-30 08:22:08.975000000 -0400 -+++ b/ufo/test/unit/common/test_ring.py 2013-04-29 15:16:22.756000000 -0400 -@@ -0,0 +1,81 @@ -+# Copyright (c) 2013 Red Hat, Inc. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -+# implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+ -+import unittest -+import gluster.swift.common.constraints -+from gluster.swift.common.ring import * -+from gluster.swift.common.Glusterfs import SWIFT_DIR -+ -+def _mock_ring_data(): -+ return [{'zone': 1, 'weight': 100.0, 'ip': '127.0.0.1', 'port': 6012, \ -+ 'meta': '', 'device': 'test', 'id': 0}, -+ {'zone': 2, 'weight': 100.0, 'ip': '127.0.0.1', 'id': 1, \ -+ 'meta': '', 'device': 'iops', 'port': 6012}] -+ -+class TestRing(unittest.TestCase): -+ """ Tests for common.utils """ -+ -+ def setUp(self): -+ self.ring = Ring(SWIFT_DIR, ring_name='object') -+ -+ def test_first_device(self): -+ try: -+ __devs = self.ring._devs -+ self.ring._devs = _mock_ring_data() -+ -+ part, node = self.ring.get_nodes('test') -+ assert node[0]['device'] == 'test' -+ node = self.ring.get_part_nodes(0) -+ assert node[0]['device'] == 'test' -+ for node in self.ring.get_more_nodes(0): -+ assert node['device'] == 'volume_not_in_ring' -+ finally: -+ self.ring._devs = __devs -+ -+ def test_invalid_device(self): -+ try: -+ __devs = self.ring._devs -+ self.ring._devs = _mock_ring_data() -+ -+ part, node = self.ring.get_nodes('test2') -+ assert node[0]['device'] == 'volume_not_in_ring' -+ node = self.ring.get_part_nodes(0) -+ assert node[0]['device'] == 'volume_not_in_ring' -+ finally: -+ self.ring._devs = __devs -+ -+ def test_second_device(self): -+ try: -+ __devs = self.ring._devs -+ self.ring._devs = _mock_ring_data() -+ -+ part, node = self.ring.get_nodes('iops') -+ assert node[0]['device'] == 'iops' -+ node = self.ring.get_part_nodes(0) -+ assert node[0]['device'] == 'iops' -+ for node in self.ring.get_more_nodes(0): -+ assert node['device'] == 'volume_not_in_ring' -+ finally: -+ self.ring._devs = __devs -+ -+ def test_second_device_with_reseller_prefix(self): -+ try: -+ __devs = self.ring._devs -+ self.ring._devs = _mock_ring_data() -+ -+ part, node = self.ring.get_nodes('AUTH_iops') -+ assert node[0]['device'] == 'iops' -+ finally: -+ self.ring._devs = __devs diff --git a/glusterfs-3.3.1.ufo.gluster.swift.common.DiskFile-1.7.4.patch b/glusterfs-3.3.1.ufo.gluster.swift.common.DiskFile-1.7.4.patch deleted file mode 100644 index 24af87f..0000000 --- a/glusterfs-3.3.1.ufo.gluster.swift.common.DiskFile-1.7.4.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ufo/gluster/swift/common/DiskFile.py.orig 2012-12-21 11:40:12.763297073 -0500 -+++ ufo/gluster/swift/common/DiskFile.py 2013-01-09 16:44:02.607838685 -0500 -@@ -55,7 +55,8 @@ - - def __init__(self, path, device, partition, account, container, obj, - logger, keep_data_fp=False, disk_chunk_size=65536, -- uid=DEFAULT_UID, gid=DEFAULT_GID): -+ uid=DEFAULT_UID, gid=DEFAULT_GID, iter_hook=None): -+ self.iter_hook = iter_hook - self.disk_chunk_size = disk_chunk_size - #Don't support obj_name ending/begining with '/', like /a, a/, /a/b/ etc - obj = obj.strip('/') diff --git a/glusterfs-3.3.2.libglusterfs.Makefile.patch b/glusterfs-3.3.2.libglusterfs.Makefile.patch deleted file mode 100644 index f539b91..0000000 --- a/glusterfs-3.3.2.libglusterfs.Makefile.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- libglusterfs/src/Makefile.am.orig 2013-07-12 13:50:20.000000000 -0400 -+++ libglusterfs/src/Makefile.am 2013-07-12 20:10:12.156000000 -0400 -@@ -48,7 +48,8 @@ - $(LEX) -t $(srcdir)/graph.l > $@ - - y.tab.h: graph.y -- $(YACC) -d $(srcdir)/graph.y -+ $(YACC) -d -b foo $(srcdir)/graph.y -+ mv foo.tab.h y.tab.h && mv foo.tab.c y.tab.c - - CLEANFILES = graph.lex.c y.tab.c y.tab.h - CONFIG_CLEAN_FILES = $(CONTRIB_BUILDDIR)/uuid/uuid_types.h ---- libglusterfs/src/Makefile.in.orig 2013-07-12 20:10:12.157000000 -0400 -+++ libglusterfs/src/Makefile.in 2013-07-12 20:12:43.022000000 -0400 -@@ -1101,7 +1101,8 @@ - $(LEX) -t $(srcdir)/graph.l > $@ - - y.tab.h: graph.y -- $(YACC) -d $(srcdir)/graph.y -+ $(YACC) -d -b foo $(srcdir)/graph.y -+ mv foo.tab.h y.tab.h && mv foo.tab.c y.tab.c - - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/glusterfs-3.4.0.swift.egginfo-grizzly.patch b/glusterfs-3.4.0.swift.egginfo-grizzly.patch deleted file mode 100644 index ec9661b..0000000 --- a/glusterfs-3.4.0.swift.egginfo-grizzly.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- a/tools/pip-requires 2013-04-05 10:55:21.988000000 -0400 -+++ b/tools/pip-requires 2013-04-05 10:55:28.649000000 -0400 -@@ -3,5 +3,5 @@ - netifaces>=0.5 - pastedeploy>=1.3.3 - simplejson>=2.0.9 --xattr>=0.4 -+pyxattr>=0.4 - python-swiftclient diff --git a/glusterfs-fuse.logrotate b/glusterfs-fuse.logrotate deleted file mode 100644 index d96663b..0000000 --- a/glusterfs-fuse.logrotate +++ /dev/null @@ -1,6 +0,0 @@ -/var/log/glusterfs/glusterfs.log { - missingok - postrotate - /usr/bin/killall -HUP gluster 2>/dev/null || true - endscript -} diff --git a/glusterfs.logrotate b/glusterfs.logrotate deleted file mode 100644 index 32b3ef9..0000000 --- a/glusterfs.logrotate +++ /dev/null @@ -1,6 +0,0 @@ -/var/log/glusterfs/glusterfs.log { - missingok - postrotate - /usr/bin/killall -HUP glusterfs 2>/dev/null || true - endscript -} diff --git a/glusterfs.spec b/glusterfs.spec deleted file mode 100644 index 4d0f0ae..0000000 --- a/glusterfs.spec +++ /dev/null @@ -1,1211 +0,0 @@ - -%global _hardened_build 1 - -%global _for_fedora_koji_builds 1 - -# uncomment and add '%' to use the prereltag for pre-releases -# %%global prereltag rc1 - -# if you wish to compile an rpm without rdma support, compile like this... -# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without rdma -%{?_without_rdma:%global _without_rdma --disable-ibverbs} - -# No RDMA Support on s390(x) -%ifarch s390 s390x -%global _without_rdma --disable-ibverbs -%endif - -# if you wish to compile an rpm without epoll... -# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without epoll -%{?_without_epoll:%global _without_epoll --disable-epoll} - -# if you wish to compile an rpm without fusermount... -# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without fusermount -%{?_without_fusermount:%global _without_fusermount --disable-fusermount} - -# if you wish to compile an rpm without geo-replication support, compile like this... -# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without georeplication -%{?_without_georeplication:%global _without_georeplication --disable-geo-replication} - -# if you wish to compile an rpm without the OCF resource agents... -# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without ocf -%{?_without_ocf:%global _without_ocf --without-ocf} - -# there is no systemtap support! Perhaps some day there will be -%global _without_systemtap --enable-systemtap=no - -# if you wish to compile an rpm without the BD map support... -# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without bd -%{?_without_bd:%global _without_bd --disable-bd-xlator} - -%if ( 0%{?rhel} && 0%{?rhel} < 6 ) -%define _without_bd --disable-bd-xlator -%endif - -%if ( 0%{?fedora} && 0%{?fedora} > 16 ) || ( 0%{?rhel} && 0%{?rhel} > 6 ) -%global _with_systemd true -%endif - -Summary: Cluster File System -%if ( 0%{_for_fedora_koji_builds} ) -Name: glusterfs -Version: 3.4.1 -Release: 2%{?prereltag:.%{prereltag}}%{?dist} -Vendor: Fedora Project -%else -Name: @PACKAGE_NAME@ -Version: @PACKAGE_VERSION@ -Release: 1%{?dist} -Vendor: glusterfs.org -%endif -License: GPLv2 or LGPLv3+ -Group: System Environment/Base -URL: http://www.gluster.org/docs/index.php/GlusterFS -%if ( 0%{_for_fedora_koji_builds} ) -Source0: http://download.gluster.org/pub/gluster/glusterfs/3.4/%{version}%{?prereltag}/glusterfs-%{version}%{?prereltag}.tar.gz -Source1: glusterd.sysconfig -Source2: glusterfsd.sysconfig -Source3: glusterfs-fuse.logrotate -Source4: glusterd.logrotate -Source5: glusterfsd.logrotate -Source6: rhel5-load-fuse-modules -Source11: glusterfsd.service -Source13: glusterfsd.init -Patch0: %{name}-3.2.5.configure.ac.patch -Patch1: %{name}-3.3.0.libglusterfs.Makefile.patch -Patch2: %{name}-3.3.1.rpc.rpcxprt.rdma.name.c.patch -%else -Source0: @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz -%endif - -BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) - -%if ( 0%{?_with_systemd:1} ) -%if ( 0%{_for_fedora_koji_builds} ) -%global glusterfsd_service %{S:%{SOURCE11}} -%endif -BuildRequires: systemd-units -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units -%define _init_enable() /bin/systemctl enable %1.service ; -%define _init_disable() /bin/systemctl disable %1.service ; -%define _init_restart() /bin/systemctl try-restart %1.service ; -%define _init_stop() /bin/systemctl stop %1.service ; -%define _init_install() %{__install} -D -p -m 0644 %1 %{buildroot}%{_unitdir}/%2.service ; -# can't seem to make a generic macro that works -%define _init_glusterd %{_unitdir}/glusterd.service -%define _init_glusterfsd %{_unitdir}/glusterfsd.service -%else -%if ( 0%{_for_fedora_koji_builds} ) -%global glusterfsd_service %{S:%{SOURCE13}} -%endif -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/service -Requires(preun): /sbin/chkconfig -Requires(postun): /sbin/service -%define _init_enable() /sbin/chkconfig --add %1 ; -%define _init_disable() /sbin/chkconfig --del %1 ; -%define _init_restart() /sbin/service %1 condrestart &>/dev/null ; -%define _init_stop() /sbin/service %1 stop &>/dev/null ; -%define _init_install() %{__install} -D -p -m 0755 %1 %{buildroot}%{_sysconfdir}/init.d/%2 ; -# can't seem to make a generic macro that works -%define _init_glusterd %{_sysconfdir}/init.d/glusterd -%define _init_glusterfsd %{_sysconfdir}/init.d/glusterfsd -%endif - -Requires: %{name}-libs = %{version}-%{release} -BuildRequires: bison flex -BuildRequires: gcc make automake libtool -BuildRequires: ncurses-devel readline-devel -BuildRequires: libxml2-devel openssl-devel -BuildRequires: libaio-devel -BuildRequires: python-devel -BuildRequires: python-ctypes -%if ( 0%{!?_without_systemtap:1} ) -BuildRequires: systemtap-sdt-devel -%endif -%if ( 0%{!?_without_bd:1} ) -BuildRequires: lvm2-devel -%endif - -Obsoletes: hekafs <= 0.7 -Obsoletes: %{name}-libs <= 2.0.0 -Obsoletes: %{name}-common < %{version}-%{release} -Obsoletes: %{name}-core < %{version}-%{release} -Provides: %{name}-libs = %{version}-%{release} -Provides: %{name}-common = %{version}-%{release} -Provides: %{name}-core = %{version}-%{release} - -# We do not want to generate useless provides and requires for xlator .so files -# Filter all generated: -# -# TODO: RHEL5 does not have a convenient solution -%if ( 0%{?rhel} == 6 ) - # filter_setup exists in RHEL6 only - %filter_provides_in %{_libdir}/glusterfs/%{version}/ - %global __filter_from_req %{?__filter_from_req} | %{__grep} -v -P '^(?!lib).*\.so.*$' - %filter_setup -%else - # modern rpm and current Fedora do not generate requires when the - # provides are filtered - %global __provides_exclude_from ^%{_libdir}/glusterfs/%{version}/.*$ -%endif - -%description -GlusterFS is a clustered file-system capable of scaling to several -petabytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file systems in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in user space and easily manageable. - -This package includes the glusterfs binary, the glusterfsd daemon and the -gluster command line, libglusterfs and glusterfs translator modules common to -both GlusterFS server and client framework. - -%package libs -Summary: GlusterFS common libraries -Group: Applications/File - -%description libs -GlusterFS is a clustered file-system capable of scaling to several -petabytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file systems in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in user space and easily manageable. - -This package provides the base GlusterFS libraries - -%package cli -Summary: GlusterFS CLI -Group: Applications/File -Requires: %{name}-libs = %{version}-%{release} - -%description cli -GlusterFS is a clustered file-system capable of scaling to several -petabytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file systems in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in user space and easily manageable. - -This package provides the GlusterFS CLI application and its man page - -%if ( 0%{!?_without_rdma:1} ) -%package rdma -Summary: GlusterFS rdma support for ib-verbs -Group: Applications/File -BuildRequires: libibverbs-devel -BuildRequires: librdmacm-devel -Requires: %{name} = %{version}-%{release} - -%description rdma -GlusterFS is a clustered file-system capable of scaling to several -petabytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file systems in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in user space and easily manageable. - -This package provides support to ib-verbs library. -%endif - -%if ( 0%{!?_without_georeplication:1} ) -%package geo-replication -Summary: GlusterFS Geo-replication -Group: Applications/File -Requires: %{name} = %{version}-%{release} -Requires: %{name}-server = %{version}-%{release} - -%description geo-replication -GlusterFS is a clustered file-system capable of scaling to several -peta-bytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file system in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in userspace and easily manageable. - -This package provides support to geo-replication. -%endif - -%package fuse -Summary: Fuse client -Group: Applications/File -BuildRequires: fuse-devel - -Requires: %{name} = %{version}-%{release} - -Obsoletes: %{name}-client < %{version}-%{release} -Provides: %{name}-client = %{version}-%{release} - -%description fuse -GlusterFS is a clustered file-system capable of scaling to several -petabytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file systems in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in user space and easily manageable. - -This package provides support to FUSE based clients. - -%package server -Summary: Clustered file-system server -Group: System Environment/Daemons -Requires: %{name} = %{version}-%{release} -Requires: %{name}-cli = %{version}-%{release} -Requires: %{name}-libs = %{version}-%{release} -Requires: %{name}-fuse = %{version}-%{release} -%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 6 ) -Requires: rpcbind -%else -Requires: portmap -%endif - -%description server -GlusterFS is a clustered file-system capable of scaling to several -petabytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file systems in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in user space and easily manageable. - -This package provides the glusterfs server daemon. - -%package api -Summary: Clustered file-system api library -Group: System Environment/Daemons -Requires: %{name} = %{version}-%{release} - -%description api -GlusterFS is a clustered file-system capable of scaling to several -petabytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file systems in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in user space and easily manageable. - -This package provides the glusterfs libgfapi library - -%if ( 0%{!?_without_ocf:1} ) -%package resource-agents -Summary: OCF Resource Agents for GlusterFS -License: GPLv3+ -%if ( ! ( 0%{?rhel} && 0%{?rhel} < 6 ) ) -# EL5 does not support noarch sub-packages -BuildArch: noarch -%endif -# this Group handling comes from the Fedora resource-agents package -%if ( 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} ) -Group: System Environment/Base -%else -Group: Productivity/Clustering/HA -%endif -# for glusterd -Requires: glusterfs-server -# depending on the distribution, we need pacemaker or resource-agents -Requires: %{_prefix}/lib/ocf/resource.d - -%description resource-agents -GlusterFS is a clustered file-system capable of scaling to several -petabytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file systems in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in user space and easily manageable. - -This package provides the resource agents which plug glusterd into -Open Cluster Framework (OCF) compliant cluster resource managers, -like Pacemaker. -%endif - -%package devel -Summary: Development Libraries -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} - -%description devel -GlusterFS is a clustered file-system capable of scaling to several -petabytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file systems in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in user space and easily manageable. - -This package provides the development libraries and include files. - -%package api-devel -Summary: Development Libraries -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} -Requires: %{name}-devel = %{version}-%{release} - -%description api-devel -GlusterFS is a clustered file-system capable of scaling to several -petabytes. It aggregates various storage bricks over Infiniband RDMA -or TCP/IP interconnect into one large parallel network file -system. GlusterFS is one of the most sophisticated file systems in -terms of features and extensibility. It borrows a powerful concept -called Translators from GNU Hurd kernel. Much of the code in GlusterFS -is in user space and easily manageable. - -This package provides the api include files. - -%prep -%setup -q -n %{name}-%{version}%{?prereltag} -%if ( 0%{_for_fedora_koji_builds} ) -#%patch0 -p0 -%patch1 -p0 -F4 -%if ( "%{version}" == "3.3.1" ) -%patch2 -p1 -%endif -%endif - -%build -./autogen.sh -%configure %{?_without_rdma} %{?_without_epoll} %{?_without_fusermount} %{?_without_georeplication} %{?_without_ocf} %{?_without_bd} %{?_without_systemtap} - -# fix hardening and remove rpath in shlibs -%if ( 0%{?fedora} && 0%{?fedora} > 17 ) || ( 0%{?rhel} && 0%{?rhel} > 6 ) -%{__sed} -i 's| \\\$compiler_flags |&\\\$LDFLAGS |' libtool -%endif -%{__sed} -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|' libtool -%{__sed} -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|' libtool - -%{__make} %{?_smp_mflags} - -%install -%{__rm} -rf %{buildroot} -%{__make} install DESTDIR=%{buildroot} -# Install include directory -%{__mkdir_p} %{buildroot}%{_includedir}/glusterfs -%{__install} -p -m 0644 libglusterfs/src/*.h \ - %{buildroot}%{_includedir}/glusterfs/ -%{__install} -p -m 0644 contrib/uuid/*.h \ - %{buildroot}%{_includedir}/glusterfs/ -# Following needed by hekafs multi-tenant translator -%{__mkdir_p} %{buildroot}%{_includedir}/glusterfs/rpc -%{__install} -p -m 0644 rpc/rpc-lib/src/*.h \ - %{buildroot}%{_includedir}/glusterfs/rpc/ -%{__install} -p -m 0644 rpc/xdr/src/*.h \ - %{buildroot}%{_includedir}/glusterfs/rpc/ -%{__mkdir_p} %{buildroot}%{_includedir}/glusterfs/server -%{__install} -p -m 0644 xlators/protocol/server/src/*.h \ - %{buildroot}%{_includedir}/glusterfs/server/ -%if ( 0%{_for_fedora_koji_builds} ) -%{__install} -D -p -m 0644 %{SOURCE1} \ - %{buildroot}%{_sysconfdir}/sysconfig/glusterd -%{__install} -D -p -m 0644 %{SOURCE2} \ - %{buildroot}%{_sysconfdir}/sysconfig/glusterfsd -%else -%{__install} -D -p -m 0644 extras/glusterd-sysconfig \ - %{buildroot}%{_sysconfdir}/sysconfig/glusterd -%endif -%if ( 0%{?rhel} && 0%{?rhel} > 5 ) -%{__mkdir_p} %{buildroot}%{python_sitelib}/gluster -touch %{buildroot}%{python_sitelib}/gluster/__init__.py -%endif - -%if ( 0%{_for_fedora_koji_builds} ) -%if ( 0%{?rhel} && 0%{?rhel} <= 5 ) -%{__install} -D -p -m 0755 %{SOURCE6} \ - %{buildroot}%{_sysconfdir}/sysconfig/modules/glusterfs-fuse.modules -%endif -%endif - -%{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterd -%{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterfs -%{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterfsd -%{__mkdir_p} %{buildroot}%{_localstatedir}/run/gluster - -# Remove unwanted files from all the shared libraries -find %{buildroot}%{_libdir} -name '*.a' -delete -find %{buildroot}%{_libdir} -name '*.la' -delete - -# Remove installed docs, they're included by %%doc -%{__rm} -rf %{buildroot}%{_datadir}/doc/glusterfs/ -head -50 ChangeLog > ChangeLog.head && mv ChangeLog.head ChangeLog -cat << EOM >> ChangeLog - -More commit messages for this ChangeLog can be found at -https://forge.gluster.org/glusterfs-core/glusterfs/commits/v%{version}%{?prereltag} -EOM - -# Remove benchmarking and other unpackaged files -%{__rm} -rf %{buildroot}/benchmarking -%{__rm} -f %{buildroot}/glusterfs-mode.el -%{__rm} -f %{buildroot}/glusterfs.vim - -# Create working directory -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd - -# Update configuration file to /var/lib working directory -sed -i 's|option working-directory /etc/glusterd|option working-directory %{_sharedstatedir}/glusterd|g' \ - %{buildroot}%{_sysconfdir}/glusterfs/glusterd.vol - -# Install glusterfsd .service or init.d file -%if ( 0%{_for_fedora_koji_builds} ) -%_init_install %{glusterfsd_service} glusterfsd -%endif - -%if ( 0%{_for_fedora_koji_builds} ) -# Client logrotate entry -%{__install} -D -p -m 0644 %{SOURCE3} \ - %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs-fuse - -# Server logrotate entry -%{__install} -D -p -m 0644 %{SOURCE4} \ - %{buildroot}%{_sysconfdir}/logrotate.d/glusterd -# Legacy server logrotate entry -%{__install} -D -p -m 0644 %{SOURCE5} \ - %{buildroot}%{_sysconfdir}/logrotate.d/glusterfsd -%else -%{__install} -D -p -m 0644 extras/glusterfs-logrotate \ - %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs -%endif - -%if ( 0%{!?_without_georeplication:1} ) -# geo-rep ghosts -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/geo-replication -touch %{buildroot}%{_sharedstatedir}/glusterd/geo-replication/gsyncd.conf -%endif - -# the rest of the ghosts -touch %{buildroot}%{_sharedstatedir}/glusterd/glusterd.info -touch %{buildroot}%{_sharedstatedir}/glusterd/options -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1 -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/stop -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/stop/post -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/stop/pre -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/start -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/start/post -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/start/pre -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/remove-brick -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/remove-brick/post -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/remove-brick/pre -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/add-brick -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/add-brick/post -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/add-brick/pre -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/set -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/set/post -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/set/pre -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/create -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/create/post -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/create/pre -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/delete -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/delete/post -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/delete/pre -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/glustershd -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/peers -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/vols -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/groups -%{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/nfs/run -touch %{buildroot}%{_sharedstatedir}/glusterd/nfs/nfs-server.vol -touch %{buildroot}%{_sharedstatedir}/glusterd/nfs/run/nfs.pid - -%clean -%{__rm} -rf %{buildroot} - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root,-) -%doc ChangeLog COPYING-GPLV2 COPYING-LGPLV3 INSTALL README THANKS -%config(noreplace) %{_sysconfdir}/logrotate.d/* -%config(noreplace) %{_sysconfdir}/sysconfig/* -%{_libdir}/glusterfs -%{_sbindir}/glusterfs* -%{_mandir}/man8/*gluster*.8* -%exclude %{_mandir}/man8/gluster.8* -%dir %{_localstatedir}/log/glusterfs -%dir %{_localstatedir}/run/gluster -%dir %{_sharedstatedir}/glusterd -%if ( 0%{!?_without_rdma:1} ) -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/rpc-transport/rdma* -%endif -# server-side, etc., xlators in other RPMs -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mount/api* -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mount/fuse* -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/storage* -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/posix* -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/protocol/server* -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mgmt* -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs* -# sample xlators not generally used or usable -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/encryption/rot-13* -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/mac-compat* -%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/testing/performance/symlink-cache* - -%post libs -/sbin/ldconfig - -%postun libs -/sbin/ldconfig - -%files libs -%{_libdir}/*.so.* -%exclude %{_libdir}/libgfapi.* - -%files cli -%{_sbindir}/gluster -%{_mandir}/man8/gluster.8* - -%if ( 0%{!?_without_rdma:1} ) -%files rdma -%defattr(-,root,root,-) -%{_libdir}/glusterfs/%{version}%{?prereltag}/rpc-transport/rdma* -%endif - -%if ( 0%{!?_without_georeplication:1} ) -%post geo-replication -#restart glusterd. -if [ $1 -ge 1 ]; then - %_init_restart glusterd -fi - -%files geo-replication -%defattr(-,root,root) -%{_libexecdir}/glusterfs/gsyncd -%{_libexecdir}/glusterfs/python/syncdaemon/* -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/geo-replication -%ghost %attr(0644,-,-) %{_sharedstatedir}/glusterd/geo-replication/gsyncd.conf -%endif - -%files fuse -%defattr(-,root,root,-) -%if ( 0%{_for_fedora_koji_builds} ) -%config(noreplace) %{_sysconfdir}/logrotate.d/glusterfs-fuse -%endif -%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mount/fuse* -/sbin/mount.glusterfs -%if ( 0%{!?_without_fusermount:1} ) -%{_bindir}/fusermount-glusterfs -%endif -%if ( 0%{_for_fedora_koji_builds} ) -%if ( 0%{?rhel} && 0%{?rhel} <= 5 ) -%{_sysconfdir}/sysconfig/modules/glusterfs-fuse.modules -%endif -%endif - -%files server -%defattr(-,root,root,-) -%doc extras/clear_xattrs.sh -%if ( 0%{_for_fedora_koji_builds} ) -%config(noreplace) %{_sysconfdir}/logrotate.d/glusterd -%endif -%config(noreplace) %{_sysconfdir}/sysconfig/glusterd -%config(noreplace) %{_sysconfdir}/glusterfs -# Legacy configs -%if ( 0%{_for_fedora_koji_builds} ) -%config(noreplace) %{_sysconfdir}/logrotate.d/glusterfsd -%config(noreplace) %{_sysconfdir}/sysconfig/glusterfsd -%endif -# init files -%_init_glusterd -%if ( 0%{_for_fedora_koji_builds} ) -%_init_glusterfsd -%endif -# binaries -%{_sbindir}/glusterd -%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/storage* -%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/posix* -%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/protocol/server* -%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mgmt* -%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs* -%ghost %attr(0644,-,-) %config(noreplace) %{_sharedstatedir}/glusterd/glusterd.info -%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/options -# This is really ugly, but I have no idea how to mark these directories in an -# other way. They should belong to the glusterfs-server package, but don't -# exist after installation. They are generated on the first start... -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1 -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/post -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/pre -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick/post -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick/pre -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/post -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/pre -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/set -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/set/post -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/set/pre -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/post -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/pre -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/post -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/pre -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/glustershd -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/vols -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/peers -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/groups -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs -%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/nfs-server.vol -%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs/run -%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/run/nfs.pid - -%post api -/sbin/ldconfig - -%postun api -/sbin/ldconfig - -%files api -%exclude %{_libdir}/*.so -%{_libdir}/libgfapi.* -%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mount/api* -%if ( 0%{?rhel} && 0%{?rhel} > 5 ) -%{python_sitelib}/gluster/__init__.p* -%endif - -%if ( 0%{!?_without_ocf:1} ) -%files resource-agents -%defattr(-,root,root) -# /usr/lib is the standard for OCF, also on x86_64 -%{_prefix}/lib/ocf/resource.d/glusterfs -%endif - -%files devel -%defattr(-,root,root,-) -%{_includedir}/glusterfs -%exclude %{_includedir}/glusterfs/y.tab.h -%exclude %{_includedir}/glusterfs/api -%exclude %{_libdir}/libgfapi.so -%{_libdir}/*.so - -%files api-devel -%{_libdir}/pkgconfig/glusterfs-api.pc -%{_libdir}/libgfapi.so -%{_includedir}/glusterfs/api/* - -%post server -# Legacy server -%_init_enable glusterd -%_init_enable glusterfsd - -# Genuine Fedora (and EPEL) builds never put gluster files in /etc; if -# there are any files in /etc from a prior gluster.org install, move them -# to /var/lib. (N.B. Starting with 3.3.0 all gluster files are in /var/lib -# in gluster.org RPMs.) Be careful to copy them on the off chance that -# /etc and /var/lib are on separate file systems -if [ -d /etc/glusterd -a ! -h %{_sharedstatedir}/glusterd ]; then - %{__mkdir_p} %{_sharedstatedir}/glusterd - cp -a /etc/glusterd %{_sharedstatedir}/glusterd - rm -rf /etc/glusterd - ln -sf %{_sharedstatedir}/glusterd /etc/glusterd -fi - -# Rename old volfiles in an RPM-standard way. These aren't actually -# considered package config files, so %config doesn't work for them. -if [ -d %{_sharedstatedir}/glusterd/vols ]; then - for file in $(find %{_sharedstatedir}/glusterd/vols -name '*.vol'); do - newfile=${file}.rpmsave - echo "warning: ${file} saved as ${newfile}" - cp ${file} ${newfile} - done -fi - -# add marker translator -# but first make certain that there are no old libs around to bite us -# BZ 834847 -if [ -e /etc/ld.so.conf.d/glusterfs.conf ]; then - rm -f /etc/ld.so.conf.d/glusterfs.conf - /sbin/ldconfig -fi -pidof -c -o %PPID -x glusterd &> /dev/null -if [ $? -eq 0 ]; then - kill -9 `pgrep -f gsyncd.py` &> /dev/null - - killall glusterd &> /dev/null - glusterd --xlator-option *.upgrade=on -N -else - glusterd --xlator-option *.upgrade=on -N -fi - - -%preun server -if [ $1 -eq 0 ]; then - if [ -f %_init_glusterfsd ]; then - %_init_stop glusterfsd - fi - %_init_stop glusterd - if [ -f %_init_glusterfsd ]; then - %_init_disable glusterfsd - fi - %_init_disable glusterd -fi -if [ $1 -ge 1 ]; then - if [ -f %_init_glusterfsd ]; then - %_init_restart glusterfsd - fi - %_init_restart glusterd -fi - - -%changelog -* Wed Oct 9 2013 Niels de Vos -- glusterfs-api-devel requires glusterfs-devel (#1016938, #1017094) - -* Tue Oct 1 2013 Kaleb S. KEITHLEY - 3.4.1-2 -- resurrect /etc/init.d/glusterfsd, BUG 1014242 - -* Fri Sep 27 2013 Kaleb S. KEITHLEY - 3.4.1-1 -- GlusterFS 3.4.1 GA, glusterfs-3.4.1-1 - -* Thu Sep 26 2013 Kaleb S. KEITHLEY - 3.4.1-0.2rc1 -- scratch build for community - -* Wed Sep 11 2013 Kaleb S. KEITHLEY - 3.4.1-0.1qa1 -- scratch build for community - -* Fri Sep 6 2013 Niels de Vos -- fix "warning: File listed twice: .../glusterd.info" while building - -* Tue Aug 6 2013 Kaleb S. KEITHLEY - 3.4.0-8 -- glusterfs-server requires glusterfs-cli - -* Mon Aug 5 2013 Kaleb S. KEITHLEY - 3.4.0-7 -- glusterfs requires glusterfs-libs - -* Mon Aug 5 2013 Kaleb S. KEITHLEY - 3.4.0-6 -- glusterfs-cli RPM to simplify dependencies for vdsm - -* Mon Aug 5 2013 Kaleb S. KEITHLEY - 3.4.0-5 -- there is no systemtap/dtrace support; don't even pretend - -* Fri Aug 2 2013 Kaleb S. KEITHLEY - 3.4.0-4 -- sync changes from upstream glusterfs.spec.in, including addition of - glusterfs-libs RPM to simplify dependencies for qemu-kvm - -* Thu Jul 25 2013 Kaleb S. KEITHLEY -- remove gsyncd from glusterfs, it's redundant with glusterfs-geo-rep - ready for next build - -* Thu Jul 25 2013 Kaleb S. KEITHLEY - 3.4.0-3 -- sync changes from upstream glusterfs.spec.in, and esp. glusterd.service - from gluster w/o Wants=glusterfsd.service - -* Thu Jul 18 2013 Kaleb S. KEITHLEY -- sync changes from upstream glusterfs.spec.in, ready for next build - -* Tue Jul 16 2013 Kaleb S. KEITHLEY - 3.4.0-2 -- tag /var/lib/glusterd/glusterd.info as %%config - -* Tue Jul 16 2013 Kaleb S. KEITHLEY - 3.2.2-2 -- tag /var/lib/glusterd/glusterd.info as %%config - -* Fri Jul 12 2013 Kaleb S. KEITHLEY - 3.4.0-1 -- GlusterFS 3.4.0 GA, glusterfs-3.4.0-1 - -* Mon Jul 8 2013 Kaleb S. KEITHLEY - 3.4.0-0.9.beta4 -- add Obsolete: glusterfs-swift where we use openstack-swift -- prerelease 3.4.0beta4 for oVirt/vdsm dependencies in Fedora19 - -* Fri Jul 5 2013 Niels de Vos -- include xlators/mount/api.so in the glusterfs-api package - -* Wed Jul 3 2013 Niels de Vos -- correct AutoRequires filtering on recent Fedora (#972465) - -* Fri Jun 28 2013 Kaleb S. KEITHLEY - 3.4.0-0.8.beta4 -- prerelease 3.4.0beta4 for oVirt/vdsm dependencies in Fedora19 - -* Thu Jun 27 2013 Niels de Vos -- correct trimming the ChangeLog, keep the recent messages (#963027) -- remove the umount.glusterfs helper (#640620) - -* Wed Jun 26 2013 Kaleb S. KEITHLEY - 3.4.0-0.7.beta3 -- prerelease 3.4.0beta3 for oVirt/vdsm dependencies in Fedora19 -- libgfapi and xlator/mount/api dependency fix - -* Tue Jun 11 2013 Kaleb S. KEITHLEY - 3.4.0-0.6.beta3 -- prerelease 3.4.0beta3 for oVirt/vdsm dependencies in Fedora19 - -* Wed May 29 2013 Niels de Vos -- automatically load the fuse module on EL5 -- there is no need to require the unused /usr/bin/fusermount -- fix building on EL5 - -* Mon May 27 2013 Niels de Vos -- include glusterfs-api.pc in the -devel subpackage - -* Fri May 24 2013 Kaleb S. KEITHLEY - 3.4.0-0.5.beta2 -- prerelease 3.4.0beta2 for oVirt/vdsm dependencies in Fedora19 - -* Thu May 9 2013 Kaleb S. KEITHLEY - 3.4.0-0.4.beta1 -- prerelease 3.4.0beta1 for oVirt/vdsm dependencies in Fedora19 - -* Wed May 8 2013 Niels de Vos -- include all Sources and Patches into the src.rpm - -* Tue May 7 2013 Kaleb S. KEITHLEY - 3.4.0-0.1.beta1 -- prerelease 3.4.0beta1 for oVirt/vdsm dependencies in Fedora19 - -* Mon Apr 29 2013 Kaleb S. KEITHLEY - 3.3.1-14 -- include backport of G4S/UFO multi-volume fix - -* Fri Apr 19 2013 Kaleb S. KEITHLEY - 3.4.0-0.3alpha3 -- #else -> %%else, a twisty maze of passages, all alike - -* Thu Apr 18 2013 Kaleb S. KEITHLEY - 3.4.0-0.2alpha3 -- prerelease 3.4.0alpha3 for oVirt/vdsm dependencies in Fedora19 -- RHEL6 still needs the patches applied, even with grizzly -- resource-agents -> noarch - -* Wed Apr 17 2013 Kaleb S. KEITHLEY - 3.4.0-0.1alpha3 -- prerelease 3.4.0alpha3 for oVirt/vdsm dependencies in Fedora19 - -* Wed Apr 17 2013 Niels de Vos - 3.3.1-13 -- remove unused requires for xlator .so files and private libraries (RHBZ#95212 - -* Mon Apr 15 2013 Kaleb S. KEITHLEY - 3.3.1-12 -- add glusterfs-3.3.1.rpc.rpcxprt.rdma.name.c.patch, BZ 920332 -- add %%{prereltag} for upcoming 3.3.2 and 3.4.0 alpha and beta builds -- add librdmacm-devel for rdma builds - -* Mon Apr 15 2013 Niels de Vos -- Remove useless provides for xlator .so files and private libraries - -* Wed Apr 10 2013 Kaleb S. KEITHLEY - 3.4.0-0.1alpha2 -- prerelease 3.4.0alpha2 for oVirt/vdsm dependencies in Fedora19 - -* Wed Mar 6 2013 Kaleb S. KEITHLEY - 3.3.1-11 -- /var/run/gluster - sync with gluster.org git -- Requires: portmap for rhel5 instead of rpcbind - -* Tue Feb 5 2013 Kaleb S. KEITHLEY - 3.3.1-10 -- sync with glusterfs.spec(.in) from gluster.org git source - -* Wed Jan 30 2013 Kaleb S. KEITHLEY - 3.3.1-9 -- essex/folsom typo, glusterfs-ufo %%files conflicts with glusterfs-swift-* - -* Thu Jan 10 2013 Kaleb S. KEITHLEY - 3.3.1-8 -- revised patch to DiskFile.py for stalled GET - -* Wed Jan 9 2013 Kaleb S. KEITHLEY - 3.3.1-7 -- additional file ownerships and associated %%ghosts from upstream -- add BuildRequires libaio-devel to auto-enable AIO in configure, - overlooked since 3.3.1-1. - -* Fri Dec 21 2012 Kaleb S. KEITHLEY - 3.3.1-6 -- fix object get, missing iter_hook param in DiskFile::__init__ - -* Mon Dec 17 2012 Kaleb S. KEITHLEY - 3.3.1-5 -- Update to OpenStack Swift 1.7.4 (Folsom) - -* Fri Dec 7 2012 Kaleb S. KEITHLEY - 3.3.1-4 -- Swift+UFO, now with less swift forkage. Specifically the only patches - to swift are those already used for the Fedora openstack-swift packages - _plus_ our backport of the upstream constraints config changes that have - been accepted into grizzly. - -* Fri Nov 16 2012 Kaleb S. KEITHLEY - 3.3.1-3 -- add Requires: rpcbind for minimum install systems where rpcbind isn't - installed; usually this is a no-op. -- Better logic to preserve contents of /etc/glusterd - -* Wed Oct 31 2012 Kaleb S. KEITHLEY - 3.3.1-2 -- Synchronize with openstack-swift-1.4.8 packaging changes, including - systemd .service files and align with the matching sets of patches - -* Thu Oct 11 2012 Kaleb S. KEITHLEY - 3.3.1-1 -- GlusterFS-3.3.1 -- save swift .conf files correctly during upgrade -- fix glusterd restart in %%post geo-replication - -* Wed Sep 19 2012 Kaleb S. KEITHLEY - 3.3.0-11 -- condrestart glusterfsd then glusterd in %%preun server - -* Wed Sep 19 2012 Kaleb S. KEITHLEY - 3.3.0-10 -- fix additional python dependencies, esp. for rhel - -* Tue Sep 18 2012 Kaleb S. KEITHLEY - 3.3.0-9 -- python-paste-deploy on RHEL 6, glusterfsd.init - -* Thu Sep 13 2012 Kaleb S. KEITHLEY - 3.3.0-8 -- fix for glusterfs SEGV, BZ 856704, revised - -* Wed Sep 12 2012 Kaleb S. KEITHLEY - 3.3.0-7 -- fix for glusterfs SEGV, BZ 856704 - -* Fri Sep 7 2012 Kaleb S. KEITHLEY - 3.3.0-6 -- glusterfs.spec cleanup - -* Mon Aug 27 2012 Kaleb S. KEITHLEY - 3.2.7-2 -- fix SEGV in glusterd-rpc-ops.c, BZ 837684, f17 only. - -* Sun Aug 12 2012 Kaleb S. KEITHLEY - 3.3.0-5 -- now with UFO (openstack-swift) except on el5 - -* Fri Aug 10 2012 Kaleb S. KEITHLEY - 3.3.0-4 -- now with UFO (openstack-swift) - -* Wed Jul 18 2012 Kaleb S. KEITHLEY - 3.3.0-3 -- fix segv in cmd_heal_volume_brick_out (RHEL seems particularly - sensitive to this bug.) - -* Thu Jul 5 2012 Kaleb S. KEITHLEY - 3.3.0-2 -- selected fixes to glusterfs.spec for BZs 826836, 826855, 829734, 834847 - -* Thu May 31 2012 Kaleb S. KEITHLEY - 3.3.0-1 -- Update to 3.3.0 - -* Wed May 9 2012 Kaleb S. KEITHLEY - 3.2.6-2 -- Add BuildRequires: libxml2-devel, BZ 819916 - -* Wed Mar 21 2012 Kaleb S. KEITHLEY - 3.2.6-1 -- Update to 3.2.6 - -* Thu Feb 16 2012 Kaleb S. KEITHLEY - 3.2.5-8 -- rename patch files - -* Mon Jan 16 2012 Kaleb S. KEITHLEY - 3.2.5-7 -- patch configure.ac to compile -O2 instead of -O0 on Linux. - -* Tue Jan 10 2012 Kaleb S. KEITHLEY - 3.2.5-6 -- glusterd.init use /run per Fedora File System Layout, or /var/run when - needed - -* Tue Jan 3 2012 Kaleb S. KEITHLEY - 3.2.5-5 -- revised spec for init.d for fedora<=16, rhel<=6; native systemd for - f17 and rhel7 - -* Wed Dec 7 2011 Kaleb S. KEITHLEY - 3.2.5-4 -- revised sysconfig and init.d scripts. (glusterfsd.{init,sysconfig,service} - should go away, as glusterd is responsible for starting and stopping it.) - -* Wed Nov 23 2011 Kaleb S. KEITHLEY - 3.2.5-3 -- revised libglusterfs/src/Makefile.* to (re)enable parallel make - -* Mon Nov 21 2011 Kaleb S. KEITHLEY - 3.2.5-2 -- rhel/epel, init.d for <=6, native systemd for 7 - -* Thu Nov 17 2011 Kaleb S. KEITHLEY - 3.2.5-1 -- Update to 3.2.5 - -* Wed Nov 16 2011 Kaleb S. KEITHLEY - 3.2.4-3 -- revised init.d/systemd to minimize fedora < 17 -- get closer to the official glusterfs spec, including... -- add geo-replication, which should have been there since 3.2 - -* Wed Nov 2 2011 Kaleb S. KEITHLEY - 3.2.4-2 -- Convert init.d to systemd for f17 and later - -* Fri Sep 30 2011 Kaleb S. KEITHLEY - 3.2.4-1 -- Update to 3.2.4 - -* Mon Aug 22 2011 Kaleb S. KEITHLEY - 3.2.3-1 -- Update to 3.2.3 - -* Mon Aug 22 2011 Kaleb S. KEITHLEY - 3.2.2-1 -- Update to 3.2.2 - -* Fri Aug 19 2011 Kaleb S. KEITHLEY - 3.2.2-0 -- Update to 3.2.2 - -* Wed Jun 29 2011 Dan Horák - 3.2.1-3 -- disable InfiniBand on s390(x) unconditionally - -* Thu Jun 16 2011 Jonathan Steffan - 3.2.1-2 -- Fix Source0 URL - -* Thu Jun 16 2011 Jonathan Steffan - 3.2.1-1 -- Update to 3.2.1 - -* Wed Jun 01 2011 Jonathan Steffan - 3.2.0-1 -- Update to 3.2.0 - -* Tue May 10 2011 Jonathan Steffan - 3.1.4-1 -- Update to 3.1.4 - -* Sat Mar 19 2011 Jonathan Steffan - 3.1.3-1 -- Update to 3.1.3 -- Merge in more upstream SPEC changes -- Remove patches from GlusterFS bugzilla #2309 and #2311 -- Remove inode-gen.patch - -* Sun Feb 06 2011 Jonathan Steffan - 3.1.2-3 -- Add back in legacy SPEC elements to support older branches - -* Thu Feb 03 2011 Jonathan Steffan - 3.1.2-2 -- Add patches from CloudFS project - -* Tue Jan 25 2011 Jonathan Steffan - 3.1.2-1 -- Update to 3.1.2 - -* Wed Jan 5 2011 Dan Horák - 3.1.1-3 -- no InfiniBand on s390(x) - -* Sat Jan 1 2011 Jonathan Steffan - 3.1.1-2 -- Update to support readline -- Update to not parallel build - -* Mon Dec 27 2010 Silas Sewell - 3.1.1-1 -- Update to 3.1.1 -- Change package names to mirror upstream - -* Mon Dec 20 2010 Jonathan Steffan - 3.0.7-1 -- Update to 3.0.7 - -* Wed Jul 28 2010 Jonathan Steffan - 3.0.5-1 -- Update to 3.0.x - -* Sat Apr 10 2010 Jonathan Steffan - 2.0.9-2 -- Move python version requires into a proper BuildRequires otherwise - the spec always turned off python bindings as python is not part - of buildsys-build and the chroot will never have python unless we - require it -- Temporarily set -D_FORTIFY_SOURCE=1 until upstream fixes code - GlusterFS Bugzilla #197 (#555728) -- Move glusterfs-volgen to devel subpackage (#555724) -- Update description (#554947) - -* Sat Jan 2 2010 Jonathan Steffan - 2.0.9-1 -- Update to 2.0.9 - -* Sun Nov 8 2009 Jonathan Steffan - 2.0.8-1 -- Update to 2.0.8 -- Remove install of glusterfs-volgen, it's properly added to - automake upstream now - -* Sat Oct 31 2009 Jonathan Steffan - 2.0.7-1 -- Update to 2.0.7 -- Install glusterfs-volgen, until it's properly added to automake - by upstream -- Add macro to be able to ship more docs - -* Thu Sep 17 2009 Peter Lemenkov 2.0.6-2 -- Rebuilt with new fuse - -* Sat Sep 12 2009 Matthias Saou 2.0.6-1 -- Update to 2.0.6. -- No longer default to disable the client on RHEL5 (#522192). -- Update spec file URLs. - -* Mon Jul 27 2009 Matthias Saou 2.0.4-1 -- Update to 2.0.4. - -* Thu Jun 11 2009 Matthias Saou 2.0.1-2 -- Remove libglusterfs/src/y.tab.c to fix koji F11/devel builds. - -* Sat May 16 2009 Matthias Saou 2.0.1-1 -- Update to 2.0.1. - -* Thu May 7 2009 Matthias Saou 2.0.0-1 -- Update to 2.0.0 final. - -* Wed Apr 29 2009 Matthias Saou 2.0.0-0.3.rc8 -- Move glusterfsd to common, since the client has a symlink to it. - -* Fri Apr 24 2009 Matthias Saou 2.0.0-0.2.rc8 -- Update to 2.0.0rc8. - -* Sun Apr 12 2009 Matthias Saou 2.0.0-0.2.rc7 -- Update glusterfsd init script to the new style init. -- Update files to match the new default vol file names. -- Include logrotate for glusterfsd, use a pid file by default. -- Include logrotate for glusterfs, using killall for lack of anything better. - -* Sat Apr 11 2009 Matthias Saou 2.0.0-0.1.rc7 -- Update to 2.0.0rc7. -- Rename "libs" to "common" and move the binary, man page and log dir there. - -* Tue Feb 24 2009 Fedora Release Engineering -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Mon Feb 16 2009 Matthias Saou 2.0.0-0.1.rc1 -- Update to 2.0.0rc1. -- Include new libglusterfsclient.h. - -* Mon Feb 16 2009 Matthias Saou 1.3.12-1 -- Update to 1.3.12. -- Remove no longer needed ocreat patch. - -* Thu Jul 17 2008 Matthias Saou 1.3.10-1 -- Update to 1.3.10. -- Remove mount patch, it's been included upstream now. - -* Fri May 16 2008 Matthias Saou 1.3.9-1 -- Update to 1.3.9. - -* Fri May 9 2008 Matthias Saou 1.3.8-1 -- Update to 1.3.8 final. - -* Wed Apr 23 2008 Matthias Saou 1.3.8-0.10 -- Include short patch to include fixes from latest TLA 751. - -* Tue Apr 22 2008 Matthias Saou 1.3.8-0.9 -- Update to 1.3.8pre6. -- Include glusterfs binary in both the client and server packages, now that - glusterfsd is a symlink to it instead of a separate binary. - -* Sun Feb 3 2008 Matthias Saou 1.3.8-0.8 -- Add python version check and disable bindings for version < 2.4. - -* Sun Feb 3 2008 Matthias Saou 1.3.8-0.7 -- Add --without client rpmbuild option, make it the default for RHEL (no fuse). - (I hope "rhel" is the proper default macro name, couldn't find it...) - -* Wed Jan 30 2008 Matthias Saou 1.3.8-0.6 -- Add --without ibverbs rpmbuild option to the package. - -* Mon Jan 14 2008 Matthias Saou 1.3.8-0.5 -- Update to current TLA again, patch-636 which fixes the known segfaults. - -* Thu Jan 10 2008 Matthias Saou 1.3.8-0.4 -- Downgrade to glusterfs--mainline--2.5--patch-628 which is more stable. - -* Tue Jan 8 2008 Matthias Saou 1.3.8-0.3 -- Update to current TLA snapshot. -- Include umount.glusterfs wrapper script (really needed? dunno). -- Include patch to mount wrapper to avoid multiple identical mounts. - -* Sun Dec 30 2007 Matthias Saou 1.3.8-0.1 -- Update to current TLA snapshot, which includes "volume-name=" fstab option. - -* Mon Dec 3 2007 Matthias Saou 1.3.7-6 -- Re-add the /var/log/glusterfs directory in the client sub-package (required). -- Include custom patch to support vol= in fstab for -n glusterfs client option. - -* Mon Nov 26 2007 Matthias Saou 1.3.7-4 -- Re-enable libibverbs. -- Check and update License field to GPLv3+. -- Add glusterfs-common obsoletes, to provide upgrade path from old packages. -- Include patch to add mode to O_CREATE opens. - -* Thu Nov 22 2007 Matthias Saou 1.3.7-3 -- Remove Makefile* files from examples. -- Include RHEL/Fedora type init script, since the included ones don't do. - -* Wed Nov 21 2007 Matthias Saou 1.3.7-1 -- Major spec file cleanup. -- Add missing %%clean section. -- Fix ldconfig calls (weren't set for the proper sub-package). - -* Sat Aug 4 2007 Matt Paine - 1.3.pre7 -- Added support to build rpm without ibverbs support (use --without ibverbs - switch) - -* Sun Jul 15 2007 Matt Paine - 1.3.pre6 -- Initial spec file diff --git a/glusterfsd.init b/glusterfsd.init deleted file mode 100644 index a4b1b55..0000000 --- a/glusterfsd.init +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh -# -# glusterfsd Startup script for the glusterfs server -# -# chkconfig: - 20 80 -# description: Clustered file-system server - -### BEGIN INIT INFO -# Provides: glusterfsd -# Required-Start: $local_fs $network -# Required-Stop: $local_fs $network -# Should-Start: -# Should-Stop: -# Default-Start: -# Default-Stop: 0 1 2 3 4 5 6 -# Short-Description: glusterfs server -# Description: Clustered file-system server -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -exec="/usr/sbin/glusterfsd" -prog="glusterfsd" - -# Set defaults, then source config for eventual overrides -GLUSTERFSD_NOFILE="65536" - -[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog - -lockfile=/var/lock/subsys/$prog - -start() { - [ -x $exec ] || exit 5 - [ $GLUSTERFSD_CONFIG -a -f $GLUSTERFSD_CONFIG ] || exit 6 - ulimit -n $GLUSTERFSD_NOFILE - echo -n $"Starting $prog: " - daemon $exec${GLUSTERFSD_CONFIG+" -f $GLUSTERFSD_CONFIG"}${GLUSTERFSD_LOGFILE+" -l $GLUSTERFSD_LOGFILE"}${GLUSTERFSD_LOGLEVEL+" -L $GLUSTERFSD_LOGLEVEL"} -p /var/run/glusterfsd.pid - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - status $prog -} - -rh_status_q() { - rh_status &>/dev/null -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? - diff --git a/glusterfsd.logrotate b/glusterfsd.logrotate deleted file mode 100644 index 81d1abc..0000000 --- a/glusterfsd.logrotate +++ /dev/null @@ -1,6 +0,0 @@ -/var/log/glusterfs/*glusterfsd.log /var/log/glusterfs/bricks/*.log { - missingok - postrotate - /bin/kill -HUP `cat /var/run/glusterfsd.pid 2>/dev/null` 2>/dev/null || true - endscript -} diff --git a/glusterfsd.service b/glusterfsd.service deleted file mode 100644 index 4454ad8..0000000 --- a/glusterfsd.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=GlusterFS an clustered file-system server -After=network.target glusterd.service - -[Service] -Type=forking -PIDFile=/run/glusterfsd.pid -LimitNOFILE=65536 -ExecStart=/usr/sbin/glusterfsd -p /run/glusterfsd.pid - -[Install] -WantedBy=multi-user.target diff --git a/glusterfsd.sysconfig b/glusterfsd.sysconfig deleted file mode 100644 index b87deb1..0000000 --- a/glusterfsd.sysconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Change the glusterfsd service defaults here. -# See "glusterfsd --help" outpout for defaults and possible values. - -#GLUSTERFSD_CONFIG="/etc/glusterfs/glusterfsd.vol" -#GLUSTERFSD_LOGFILE="/var/log/glusterfs/glusterfs.log" -#GLUSTERFSD_LOGLEVEL="NORMAL" diff --git a/object-expirer.conf b/object-expirer.conf deleted file mode 100644 index b75963c..0000000 --- a/object-expirer.conf +++ /dev/null @@ -1,17 +0,0 @@ -[DEFAULT] - -[object-expirer] -# auto_create_account_prefix = . - -[pipeline:main] -pipeline = catch_errors cache proxy-server - -[app:proxy-server] -use = egg:swift#proxy - -[filter:cache] -use = egg:swift#memcache -memcache_servers = 127.0.0.1:11211 - -[filter:catch_errors] -use = egg:swift#catch_errors diff --git a/object-server.conf b/object-server.conf deleted file mode 100644 index 3a3d9be..0000000 --- a/object-server.conf +++ /dev/null @@ -1,16 +0,0 @@ -[DEFAULT] -bind_ip = 127.0.0.1 -bind_port = 6010 -workers = 3 - -[pipeline:main] -pipeline = object-server - -[app:object-server] -use = egg:swift#object - -[object-replicator] - -[object-updater] - -[object-auditor] diff --git a/openstack-swift-docmod.patch b/openstack-swift-docmod.patch deleted file mode 100644 index 03f193c..0000000 --- a/openstack-swift-docmod.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- swift-1.4.4/doc/source/conf.py.orig 2011-11-24 08:59:50.000000000 -0500 -+++ swift-1.4.4/doc/source/conf.py 2012-01-04 22:35:55.571492761 -0500 -@@ -31,7 +31,10 @@ - # If extensions (or modules to document with autodoc) are in another directory, - # add these directories to sys.path here. If the directory is relative to the - # documentation root, use os.path.abspath to make it absolute, like shown here. --sys.path.append([os.path.abspath('../swift'), os.path.abspath('..'), os.path.abspath('../bin')]) -+sys.path = [os.path.abspath('../../swift'), -+ os.path.abspath('../..'), -+ os.path.abspath('../../bin') -+ ] + sys.path - - # -- General configuration ----------------------------------------------------- - diff --git a/openstack-swift-newdeps.patch b/openstack-swift-newdeps.patch deleted file mode 100644 index 3b4222a..0000000 --- a/openstack-swift-newdeps.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru swift-1.4.4-ORIG/swift/__init__.py swift-1.4.4/swift/__init__.py ---- swift-1.4.4-ORIG/swift/__init__.py 2011-11-24 14:59:50.000000000 +0100 -+++ swift-1.4.4/swift/__init__.py 2012-01-04 00:09:10.122030579 +0100 -@@ -1,3 +1,32 @@ -+import sys -+import pkg_resources -+ -+# If there is a conflicting non egg module, -+# i.e. an older standard system module installed, -+# then replace it with this requirement -+def replace_dist(requirement): -+ try: -+ return pkg_resources.require(requirement) -+ except pkg_resources.VersionConflict: -+ e = sys.exc_info()[1] -+ dist=e.args[0] -+ req=e.args[1] -+ if dist.key == req.key and not dist.location.endswith('.egg'): -+ del pkg_resources.working_set.by_key[dist.key] -+ # We assume there is no need to adjust sys.path -+ # and the associated pkg_resources.working_set.entries -+ return pkg_resources.require(requirement) -+ -+replace_dist("WebOb >= 1.0") -+ -+replace_dist("PasteDeploy >= 1.5.0") -+# This hack is needed because replace_dist() results in -+# the standard paste module path being at the start of __path__. -+# TODO: See can we get pkg_resources to do the right thing directly -+import paste -+paste.__path__.insert(0, paste.__path__.pop(-1)) -+ -+ - import gettext - - diff --git a/openstack-swift-nonet.patch b/openstack-swift-nonet.patch deleted file mode 100644 index af8cad4..0000000 --- a/openstack-swift-nonet.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- swift-1.4.4/doc/source/conf.py.orig 2012-01-04 22:40:43.190300958 -0500 -+++ swift-1.4.4/doc/source/conf.py 2012-01-04 22:41:26.980492712 -0500 -@@ -40,7 +40,7 @@ - - # Add any Sphinx extension module names here, as strings. They can be extensions - # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. --extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig'] -+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig'] - todo_include_todos = True - - # Add any paths that contain templates here, relative to this directory. diff --git a/proxy-server.conf b/proxy-server.conf deleted file mode 100644 index 3e4b88a..0000000 --- a/proxy-server.conf +++ /dev/null @@ -1,39 +0,0 @@ -[DEFAULT] -bind_port = 8080 -workers = 8 -user = swift - -[pipeline:main] -pipeline = healthcheck cache authtoken keystone proxy-server - -[app:proxy-server] -use = egg:swift#proxy -allow_account_management = true -account_autocreate = true - -[filter:cache] -use = egg:swift#memcache -memcache_servers = 127.0.0.1:11211 - -[filter:catch_errors] -use = egg:swift#catch_errors - -[filter:healthcheck] -use = egg:swift#healthcheck - -[filter:keystone] -paste.filter_factory = keystone.middleware.swift_auth:filter_factory -operator_roles = admin, SwiftOperator -is_admin = true -cache = swift.cache - -[filter:authtoken] -paste.filter_factory = keystone.middleware.auth_token:filter_factory -admin_tenant_name = %SERVICE_TENANT_NAME% -admin_user = %SERVICE_USER% -admin_password = %SERVICE_PASSWORD% -auth_host = 127.0.0.1 -auth_port = 35357 -auth_protocol = http -signing_dir = /tmp/keystone-signing-swift - diff --git a/rhel5-load-fuse-modules b/rhel5-load-fuse-modules deleted file mode 100755 index ee194db..0000000 --- a/rhel5-load-fuse-modules +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# -# fusermount-glusterfs requires the /dev/fuse character device. The fuse module -# provides this and is loaded on demand in newer Linux distributions. -# - -[ -c /dev/fuse ] || /sbin/modprobe fuse diff --git a/sources b/sources deleted file mode 100644 index e68d688..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -dce3d066b7351b360454ea9ca4cabe4c glusterfs-3.4.1.tar.gz diff --git a/swift.conf b/swift.conf deleted file mode 100644 index adbd96f..0000000 --- a/swift.conf +++ /dev/null @@ -1,2 +0,0 @@ -[swift-hash] -swift_hash_path_suffix = %SWIFT_HASH_PATH_SUFFIX%