preliminary update to swift-1.7.4

This commit is contained in:
Kaleb S. KEITHLEY 2012-12-11 15:53:05 -05:00
parent fdd4bcfad0
commit 096dd5c2aa
31 changed files with 1111 additions and 29 deletions

3
.gitignore vendored
View File

@ -14,6 +14,7 @@ glusterfs-3.2.6.tar.gz
glusterfs-3.2.7.tar.gz
glusterfs-3.3.0.tar.gz
glusterfs-3.3.1.tar.gz
swift-1.4.8.tar.gz
swift-*.tar.gz
gluster-swift-ufo-1.1.tar.gz
*.src.rpm

View File

@ -0,0 +1,53 @@
From 43e8681d5cbd6c919e379fe25cccc189827e2d60 Mon Sep 17 00:00:00 2001
From: Alan Pevec <apevec@redhat.com>
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 <P@draigBrady.com>
---
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

View File

@ -0,0 +1,37 @@
From 7df10fb14d27e35faa590770594ea1b05552576f Mon Sep 17 00:00:00 2001
From: Alan Pevec <apevec@redhat.com>
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 <P@draigBrady.com>
---
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

16
account-server.conf Normal file
View File

@ -0,0 +1,16 @@
[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]

18
container-server.conf Normal file
View File

@ -0,0 +1,18 @@
[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]

View File

@ -0,0 +1,12 @@
# 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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,12 @@
# 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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,12 @@
# 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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,12 @@
# 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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,12 @@
# 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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,11 @@
[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

View File

@ -0,0 +1,567 @@
From 9ce581c9c548c6a843e682f79f9ae510121501ac Mon Sep 17 00:00:00 2001
From: Peter Portante <peter.portante@redhat.com>
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

View File

@ -22,7 +22,7 @@
%{?_without_georeplication:%global _without_georeplication --disable-geo-replication}
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 6 )
%global SWIFTVER 1.4.8
%global SWIFTVER 1.7.4
%global UFOVER 1.1
%global _with_ufo true
%endif
@ -33,7 +33,7 @@
Summary: Cluster File System
Name: glusterfs
Version: 3.3.1
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv3+ and (GPLv2 or LGPLv3+)
Group: System Environment/Base
Vendor: Red Hat
@ -67,11 +67,8 @@ Requires(postun): systemd-units
%define _init_glusterd %{_unitdir}/glusterd.service
%define _init_glusterfsd %{_unitdir}/glusterfsd.service
%define _init_gluster_swift_account %{_unitdir}/gluster-swift-account.service
%define _init_gluster_swift_account_at %{_unitdir}/gluster-swift-account@.service
%define _init_gluster_swift_object %{_unitdir}/gluster-swift-object.service
%define _init_gluster_swift_object_at %{_unitdir}/gluster-swift-object@.service
%define _init_gluster_swift_container %{_unitdir}/gluster-swift-container.service
%define _init_gluster_swift_container_at %{_unitdir}/gluster-swift-container@.service
%define _init_gluster_swift_proxy %{_unitdir}/gluster-swift-proxy.service
%else
Source7: glusterd.init
@ -231,6 +228,14 @@ License: ASL 2.0
BuildArch: noarch
Source10: http://launchpad.net/swift/essex/%{SWIFTVER}/+download/swift-%{SWIFTVER}.tar.gz
%if ( 0%{?fedora} && 0%{?fedora} > 17 ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
# these first appeared in openstack-swift-1.7.4-1.fc18 and -1.7.4-2.el6
Source100: account-server.conf
Source101: container-server.conf
Source102: object-server.conf
Source103: proxy-server.conf
Source104: swift.conf
%endif
%if 0%{?_with_systemd:1}
Source11: gluster-swift-account.service
Source12: gluster-swift-account@.service
@ -239,7 +244,30 @@ Source14: gluster-swift-container@.service
Source15: gluster-swift-object.service
Source16: gluster-swift-object@.service
Source17: gluster-swift-proxy.service
Source19: gluster-swift.tmpfs
Source18: gluster-swift.tmpfs
%if ( 0%{?fedora} && 0%{?fedora} > 18 )
# these first appeared in openstack-swift-1.7.4-2.fc19
Source110: gluster-swift-account-replicator.service
Source111: gluster-swift-account-replicator@.service
Source112: gluster-swift-account-auditor.service
Source113: gluster-swift-account-auditor@.service
Source114: gluster-swift-account-reaper.service
Source115: gluster-swift-account-reaper@.service
Source116: gluster-swift-container-replicator.service
Source117: gluster-swift-container-replicator@.service
Source118: gluster-swift-container-auditor.service
Source119: gluster-swift-container-auditor@.service
Source120: gluster-swift-container-updater.service
Source121: gluster-swift-container-updater@.service
Source122: gluster-swift-object-replicator.service
Source123: gluster-swift-object-replicator@.service
Source124: gluster-swift-object-auditor.service
Source125: gluster-swift-object-auditor@.service
Source126: gluster-swift-object-updater.service
Source127: gluster-swift-object-updater@.service
Source128: gluster-swift-object-expirer.service
Source129: gluster-swift-object-expirer@.service
%endif
%else
Source11: gluster-swift-account.init
Source12: gluster-swift-container.init
@ -247,14 +275,11 @@ Source13: gluster-swift-object.init
Source14: gluster-swift-proxy.init
Source18: gluster-swift-functions
%endif
Patch10: 0001-Do-not-use-pickle-for-serialization-in-memcache-but-.patch
Patch11: 0002-Fix-bug-where-serialization_format-is-ignored.patch
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
Patch12: openstack-swift-newdeps.patch
Patch13: openstack-swift-docmod.patch
Patch14: openstack-swift-nonet.patch
Patch10: 0001-Use-updated-parallel-install-versions-of-epel-packag.patch
Patch11: 0002-Add-fixes-for-building-the-doc-package.patch
%endif
Patch15: glusterfs-3.3.1.swift.constraints.backport.patch
Patch12: glusterfs-3.3.1.swift.constraints.backport-1.7.4.patch
#BuildRoot: %(mktemp -ud %{_tmppath}/swift-%{SWIFTVER}-%{release}-XXXXXX)
BuildRequires: dos2unix
@ -404,14 +429,11 @@ storage costs.
#%patch0 -p0
%patch1 -p0
cd swift-%{SWIFTVER}
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
%patch10 -p1
%patch11 -p1
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
%patch12 -p1
%patch13 -p1
%patch14 -p1
%endif
%patch15 -p1
%patch12 -p1
dos2unix LICENSE
%endif
@ -547,17 +569,36 @@ cd swift-%{SWIFTVER}
%_init_install %{SOURCE15} gluster-swift-object
%_init_install %{SOURCE16} gluster-swift-object@
%_init_install %{SOURCE17} gluster-swift-proxy
# tmpfs conf
%{__mkdir_p} %{buildroot}%{_sysconfdir}/tmpfiles.d
install -p -m 0644 %{SOURCE19} %{buildroot}%{_sysconfdir}/tmpfiles.d/gluster-swift.conf
%if ( 0%{?fedora} && 0%{?fedora} > 18 )
%_init_install %{SOURCE110} gluster-swift-account-replicator
%_init_install %{SOURCE111} gluster-swift-account-replicator@
%_init_install %{SOURCE112} gluster-swift-account-auditor
%_init_install %{SOURCE113} gluster-swift-account-auditor@
%_init_install %{SOURCE114} gluster-swift-account-reaper
%_init_install %{SOURCE115} gluster-swift-account-reaper@
%_init_install %{SOURCE116} gluster-swift-container-replicator
%_init_install %{SOURCE117} gluster-swift-container-replicator@
%_init_install %{SOURCE118} gluster-swift-container-auditor
%_init_install %{SOURCE119} gluster-swift-container-auditor@
%_init_install %{SOURCE120} gluster-swift-container-updater
%_init_install %{SOURCE121} gluster-swift-container-updater@
%_init_install %{SOURCE122} gluster-swift-object-replicator
%_init_install %{SOURCE123} gluster-swift-object-replicator@
%_init_install %{SOURCE124} gluster-swift-object-auditor
%_init_install %{SOURCE125} gluster-swift-object-auditor@
%_init_install %{SOURCE126} gluster-swift-object-updater
%_init_install %{SOURCE127} gluster-swift-object-updater@
%_init_install %{SOURCE128} gluster-swift-object-expirer
%_init_install %{SOURCE129} gluster-swift-object-expirer@
%endif
%else
# Init helper functions
%{__install} -p -D -m 644 %{SOURCE18} %{buildroot}%{_datarootdir}/gluster-swift/functions
# Init scripts
%_init_install %{SOURCE11} gluster-swift-account
%_init_install %{SOURCE12} gluster-swift-container
%_init_install %{SOURCE13} gluster-swift-object
%_init_install %{SOURCE14} gluster-swift-proxy
# Init helper functions
%{__install} -p -D -m 644 %{SOURCE18} %{buildroot}%{_datarootdir}/gluster-swift/functions
%endif
# Misc other
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/swift
@ -565,12 +606,35 @@ install -p -m 0644 %{SOURCE19} %{buildroot}%{_sysconfdir}/tmpfiles.d/gluster-swi
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/swift/container-server
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/swift/object-server
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/swift/proxy-server
# Config files
%if ( 0%{?fedora} && 0%{?fedora} > 17 )
# these first appeared in openstack-swift-1.7.4-1.fc18
install -p -D -m 660 %{SOURCE100} %{buildroot}%{_sysconfdir}/swift/account-server.conf
install -p -D -m 660 %{SOURCE101} %{buildroot}%{_sysconfdir}/swift/container-server.conf
install -p -D -m 660 %{SOURCE102} %{buildroot}%{_sysconfdir}/swift/object-server.conf
install -p -D -m 660 %{SOURCE103} %{buildroot}%{_sysconfdir}/swift/proxy-server.conf
install -p -D -m 660 %{SOURCE104} %{buildroot}%{_sysconfdir}/swift/swift.conf
%endif
# Install pid directory
%{__install} -d -m 755 %{buildroot}%{_localstatedir}/run/swift
%{__install} -d -m 755 %{buildroot}%{_localstatedir}/run/swift/account-server
%{__install} -d -m 755 %{buildroot}%{_localstatedir}/run/swift/container-server
%{__install} -d -m 755 %{buildroot}%{_localstatedir}/run/swift/object-server
%{__install} -d -m 755 %{buildroot}%{_localstatedir}/run/swift/proxy-server
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
# Swift run directories
%{__mkdir_p} %{buildroot}%{_sysconfdir}/tmpfiles.d
install -p -m 0644 %{SOURCE18} %{buildroot}%{_sysconfdir}/tmpfiles.d/gluster-swift.conf
%endif
# man pages
install -d -m 755 %{buildroot}%{_mandir}/man5
for m in doc/manpages/*.5; do
install -p -m 0644 $m %{buildroot}%{_mandir}/man5
done
install -d -m 755 %{buildroot}%{_mandir}/man1
for m in doc/manpages/*.1; do
install -p -m 0644 $m %{buildroot}%{_mandir}/man1
done
cd ..
cd ufo
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
@ -716,15 +780,26 @@ fi
%doc swift-%{SWIFTVER}/etc/drive-audit.conf-sample
%doc swift-%{SWIFTVER}/etc/object-expirer.conf-sample
%doc swift-%{SWIFTVER}/etc/swift.conf-sample
%{_mandir}/man5/dispersion.conf.5*
%{_mandir}/man1/swift-dispersion-populate.1*
%{_mandir}/man1/swift-dispersion-report.1*
%{_mandir}/man1/swift.1*
%{_mandir}/man1/swift-get-nodes.1*
%{_mandir}/man1/swift-init.1*
%{_mandir}/man1/swift-orphans.1*
%{_mandir}/man1/swift-recon.1*
%{_mandir}/man1/swift-ring-builder.1*
%if 0%{?_with_systemd:1}
%config(noreplace) %{_sysconfdir}/tmpfiles.d/gluster-swift.conf
%else
%dir %{_datarootdir}/gluster-swift/functions
%endif
%dir %attr(0755, swift, swift) %{_localstatedir}/run/swift
%dir %{_sysconfdir}/swift
%if ( 0%{?fedora} && 0%{?fedora} > 17 )
%config(noreplace) %attr(660, root, swift) %{_sysconfdir}/swift/swift.conf
%endif
%dir %attr(0755, swift, swift) %{_localstatedir}/run/swift
%dir %{python_sitelib}/swift
%{_bindir}/swift
%{_bindir}/swift-account-audit
%{_bindir}/swift-bench
%{_bindir}/swift-drive-audit
@ -746,11 +821,19 @@ fi
%files swift-account
%defattr(-,root,root,-)
%doc swift-%{SWIFTVER}/etc/account-server.conf-sample
%{_mandir}/man5/account-server.conf.5*
%{_mandir}/man1/swift-account-auditor.1*
%{_mandir}/man1/swift-account-reaper.1*
%{_mandir}/man1/swift-account-replicator.1*
%{_mandir}/man1/swift-account-server.1*
%_init_gluster_swift_account
%if 0%{?_with_systemd:1}
%_init_gluster_swift_account_at
%{_unitdir}/gluster-swift-account*.service
%endif
%dir %attr(0755, swift, swift) %{_localstatedir}/run/swift/account-server
%if ( 0%{?fedora} && 0%{?fedora} > 17 )
%config(noreplace) %attr(660, root, swift) %{_sysconfdir}/swift/account-server.conf
%endif
%dir %{_sysconfdir}/swift/account-server
%{_bindir}/swift-account-auditor
%{_bindir}/swift-account-reaper
@ -761,11 +844,20 @@ fi
%files swift-container
%defattr(-,root,root,-)
%doc swift-%{SWIFTVER}/etc/container-server.conf-sample
%{_mandir}/man5/container-server.conf.5*
%{_mandir}/man1/swift-container-auditor.1*
%{_mandir}/man1/swift-container-replicator.1*
%{_mandir}/man1/swift-container-server.1*
%{_mandir}/man1/swift-container-sync.1*
%{_mandir}/man1/swift-container-updater.1*
%_init_gluster_swift_container
%if 0%{?_with_systemd:1}
%_init_gluster_swift_container_at
%{_unitdir}/gluster-swift-container*.service
%endif
%dir %attr(0755, swift, swift) %{_localstatedir}/run/swift/container-server
%if ( 0%{?fedora} && 0%{?fedora} > 17 )
%config(noreplace) %attr(660, root, swift) %{_sysconfdir}/swift/container-server.conf
%endif
%dir %{_sysconfdir}/swift/container-server
%{_bindir}/swift-container-auditor
%{_bindir}/swift-container-server
@ -778,11 +870,22 @@ fi
%defattr(-,root,root,-)
%doc swift-%{SWIFTVER}/etc/object-server.conf-sample
%doc swift-%{SWIFTVER}/etc/rsyncd.conf-sample
%{_mandir}/man5/object-server.conf.5*
%{_mandir}/man5/object-expirer.conf.5*
%{_mandir}/man1/swift-object-auditor.1*
%{_mandir}/man1/swift-object-expirer.1*
%{_mandir}/man1/swift-object-info.1*
%{_mandir}/man1/swift-object-replicator.1*
%{_mandir}/man1/swift-object-server.1*
%{_mandir}/man1/swift-object-updater.1*
%_init_gluster_swift_object
%if 0%{?_with_systemd:1}
%_init_gluster_swift_object_at
%{_unitdir}/gluster-swift-object*.service
%endif
%dir %attr(0755, swift, swift) %{_localstatedir}/run/swift/object-server
%if ( 0%{?fedora} && 0%{?fedora} > 17 )
%config(noreplace) %attr(660, root, swift) %{_sysconfdir}/swift/object-server.conf
%endif
%dir %{_sysconfdir}/swift/object-server
%{_bindir}/swift-object-auditor
%{_bindir}/swift-object-info
@ -794,8 +897,13 @@ fi
%files swift-proxy
%defattr(-,root,root,-)
%doc swift-%{SWIFTVER}/etc/proxy-server.conf-sample
%{_mandir}/man5/proxy-server.conf.5*
%{_mandir}/man1/swift-proxy-server.1*
%_init_gluster_swift_proxy
%dir %attr(0755, swift, swift) %{_localstatedir}/run/swift/proxy-server
%if ( 0%{?fedora} && 0%{?fedora} > 17 )
%config(noreplace) %attr(660, root, swift) %{_sysconfdir}/swift/proxy-server.conf
%endif
%dir %{_sysconfdir}/swift/proxy-server
%{_bindir}/swift-proxy-server
%{python_sitelib}/swift/proxy

16
object-server.conf Normal file
View File

@ -0,0 +1,16 @@
[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]

39
proxy-server.conf Normal file
View File

@ -0,0 +1,39 @@
[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

View File

@ -1,3 +1,3 @@
4c9f291de887b1193d5d1acac4003360 glusterfs-3.3.1.tar.gz
785ae9ba4e1f6fc256cd6a697bb2861f swift-1.4.8.tar.gz
1cfb85335eafc4317414736477d47dfc swift-1.7.4.tar.gz
c1041b0551be722363f18f3a5664d0cf gluster-swift-ufo-1.1.tar.gz

2
swift.conf Normal file
View File

@ -0,0 +1,2 @@
[swift-hash]
swift_hash_path_suffix = %SWIFT_HASH_PATH_SUFFIX%