9b521fe800ed3984169d37e9772674867745fede
Commit Graph

3153 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
Clay Gerrard
d51e873423 Remove keep_data_fp argument from DiskFile constructor
All access to the data_file fp for DiskFile is moved after the new "open"
method. This prepares to move some additional smarts into DiskFile and reduce
the surface area of the abstraction and the exposure of the underlying
implementation in the object-server.
Future work:
 * Consolidate put_metadata to DiskWriter
 * Add public "update_metdata" method to DiskFile
 * Create DiskReader class to gather all access of methods under "open"
Change-Id: I4de2f265bf099a810c5f1c14b5278d89bd0b382d
2013年09月10日 17:51:56 -07:00
Pete Zaitcev
d4b024ad7d Split backends off swift/common/db.py
The main purpose of this patch is to lay the groundwork for allowing
the container and account servers to optionally use pluggable backend
implementations. The backend.py files will eventually be the module
where the backend APIs are defined via docstrings of this reference
implementation. The swift/common/db.py module will remain an internal
module used by the reference implementation.
We have a raft of changes to docstrings staged for later, but this
patch takes care to relocate ContainerBroker and AccountBroker into
their new home intact.
Change-Id: Ibab5c7605860ab768c8aa5a3161a705705689b04
2013年09月10日 13:30:28 -06:00
Fabien Boucher
fffc95c3cc Handle X-Copy-From header in account_quota mw
Content length of the copied object
is checked before allowing the copy
request according to the account
quota set by Reseller.
Fixes: bug #1200271
Change-Id: Ie4700f23466dd149ea5a497e6c72438cf52940fd
2013年09月10日 17:12:46 +02:00
Peter Portante
30b1590c3c Assume ETag is always in the metadata
Currently the GET and HEAD calls always assume that the ETag is
present in the on-disk metadata, as they index the metadata dictionary
directly for the value to fill in the proper response header (a
KeyError would be thrown if missing and turn into a 503).
The close code that handles quarantining checked to see if an ETag is
present in the metadata before making the comparison. However, a close
operation would never even be attempted if an ETag was not present,
since the response headers are filled in before the object is read.
Change-Id: I5032251414eceb38079d235504cc9e589dea5f3e
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月10日 07:29:01 -04:00
Jenkins
21c322c35d Merge "[tempauth] update token if its value changes or expires" 2013年09月10日 04:11:52 +00:00
Jenkins
077c19b066 Merge "fix swift i18n" 2013年09月10日 03:57:24 +00:00
Jenkins
88bc01ab6d Merge "Remove dupe account_audit when reporting stats" 2013年09月10日 03:45:55 +00:00
Clay Gerrard
ce12d66cf9 fix swift i18n
Change-Id: I53cea28a6d7593a1b308dbcf77dddf7f40d76cb2
2013年09月09日 20:25:00 -07:00
Jenkins
2b91f2675f Merge "Add Apache 2.0 licensing headers" 2013年09月10日 00:08:28 +00:00
Jenkins
de4da072aa Merge "Perform fewer stat calls when doing auditing of objects" 2013年09月09日 23:04:44 +00:00
Jenkins
5ff77f4702 Merge "Provide a method for retrieving on-disk metadata" 2013年09月09日 23:04:25 +00:00
Jenkins
7492262da8 Merge "Fixed a suite that was over-indented" 2013年09月09日 22:57:51 +00:00
Jenkins
00a31f5f15 Merge "Fix unbalanced rings after initial creation." 2013年09月09日 22:57:15 +00:00
Jenkins
6cd3029dae Merge "Move string expansion outside localisation (H702)" 2013年09月09日 22:27:55 +00:00
Jenkins
ce93bfa7f0 Merge "Use Python 3.x compatible except construct" 2013年09月09日 22:27:32 +00:00
Jenkins
7e05208863 Merge "Do not use locals() for string formatting (H501)" 2013年09月09日 22:27:30 +00:00
Alex Gaynor
54d5f3bde9 Fixed a suite that was over-indented
Change-Id: I3d05b29e57b77c3751d9f5ff694085bd082e8eb1
2013年09月09日 14:49:39 -07:00
Alex Gaynor
537626ac6b Don't stat the path in `unlink_older_than`
``listdir`` already handles the ENOENT and returns an empty list in
that case.
Change-Id: I597d7ffa9979f668a856519062839505d26129f2
2013年09月09日 09:58:26 -07:00
Jenkins
e8bf111f6a Merge "Made the signature of HeaderKeyDict.__init__ match dict's" 2013年09月07日 16:37:39 +00:00
Dirk Mueller
816c73e015 Add Apache 2.0 licensing headers
Change-Id: I38fae2a78b2369a897b7f298c1aead9b963bf7c9
2013年09月07日 16:31:06 +02:00
Dirk Mueller
00f9d718d2 Move string expansion outside localisation (H702)
String expansion should be done outside localisation call (_()),
otherwise there will never be a matching string found in the
catalogue.
Also enable gating on this Hacking check (H702).
Change-Id: Ie7c89fbfb52629e75d5e68e9afda8bcf50bf4cdd
2013年09月07日 10:51:21 +02:00
Dirk Mueller
3d36a76156 Use Python 3.x compatible except construct
except x,y: was deprected and is removed in Python 3.x.
Use "except x as y:" instead which works in any Python
version >= 2.6.
Change-Id: I7008c74b807340f3457d3a0c8bd0b83f23169d14
2013年09月07日 10:50:54 +02:00
Dirk Mueller
3102ad48d5 Do not use locals() for string formatting (H501)
Fixes a warning triggered by Hacking 0.7.x or newer. There
is no need to use a positional string formatting here, since
this is not going to be localized.
Change-Id: Ie38d620aecb0b48cd113af45cc9ca0d61f8f8ff1
2013年09月07日 10:26:57 +02:00
Peter Portante
698023f477 Provide a method for retrieving on-disk metadata
We hide the internal dictionary for the metadata providing a method to
retrieve it to abstract away the implementation details of how
DiskFile object provides and maintains that metadata.
This is in anticipation of the DiskFile API refactoring.
Change-Id: I1c0dc01a4680bd435512405e2d31fba24421720a
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月06日 18:11:35 -04:00
Jenkins
8a255a3415 Merge "Refactor finalize_put as an object method" 2013年09月06日 21:38:56 +00:00
Jenkins
e133a26760 Merge "Remove reference to 'file' built-in" 2013年09月06日 21:01:10 +00:00
Peter Portante
9d98070f7b Remove reference to 'file' built-in
Change-Id: Ie79e8ede393e92824fd906df1ff1933193c00943
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月06日 13:44:09 -04:00
Alex Gaynor
12f95cc5a1 Perform fewer stat calls when doing auditing of objects
Each `isdir` or `exists` call performs a stat, but that info is already
available from the exception if it doesn't exist in `listdir`.
Change-Id: I831494e3dbc8fda62ab29431471566bdb8dc6d27
2013年09月05日 18:57:03 -07:00
Peter Portante
fdfa34e119 Add a delete() method to DiskFile
In preparation for making the DiskFile class an abstraction layer for
the backend to all the object server REST API services, we add a
simple delete method which encapsulates the required behavior.
Change-Id: I539ad53c297e4c572e2f93c2524188fb89b2db40
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月05日 19:47:06 -04:00
Peter Portante
9e7c56a2c9 Rename DiskFile.writer to create
Change-Id: I3af71c64dd4c61e665fe128a0b5241fd87ba71e0
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月05日 19:47:06 -04:00
Florian Hines
57f97e71d7 Remove dupe account_audit when reporting stats
- Remove duplicate account_audit call that happened once an hour when stats
where reported.
- And fixed a flake8 complaint
Change-Id: Ide686c475f8648664e9cffdd696629cf6ba9f75c
2013年09月05日 18:39:00 -05:00
Jenkins
f1940bb05a Merge "add reseller_admin_role to sample config" 2013年09月05日 20:22:31 +00:00
John Dickinson
a9aec73098 add reseller_admin_role to sample config
Change-Id: Ia8e62eef5af9e849e86c3ff14ce7f8aaa5f21abf
2013年09月05日 12:27:18 -07:00
Peter Portante
93ab856f66 Add support for POST commit coverage runs
Modeled on how keystone does it.
Change-Id: Idad4f854f1bfb915a48ff69988553810a76accc0
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月05日 13:50:43 -04:00
Peter Portante
22451b22cb Pep8 final two unit test modules and enforce (12 of 12)
We also fix up any other pep8 failures that snuck in from merges along
the way.
Change-Id: I4ea984780ac2eac458c98fe181684eef4e04beaf
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月04日 23:35:46 -04:00
Peter Portante
14037b46e6 Flake8 container test_server.py (11 of 12)
Change-Id: Ie06ed2955838556d5399a49ba3599dfbca4f7512
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月04日 22:25:55 -04:00
Jenkins
f5a54a3264 Merge "Pep8 account and proxy server unit tests (10 of 12)" 2013年09月05日 01:46:22 +00:00
Jenkins
1c74962ec9 Merge "Rename param to avoid use of built-in name hash" 2013年09月05日 01:12:06 +00:00
Jenkins
6ec99a73f9 Merge "Pep8 container test_sync and test_diskfile (9 of 12)" 2013年09月05日 00:09:22 +00:00
Jenkins
dac2893026 Merge "Pep8 remaining unit test modules in common (8 of 12)" 2013年09月04日 23:26:22 +00:00
Jenkins
090f183c5e Merge "Pep8 unit tests in middleware > 20 violations (7 of 12)" 2013年09月04日 22:25:50 +00:00
Jenkins
65ae15d780 Merge "Pep8 unit test modules w/ <= 20 violations (6 of 12)" 2013年09月04日 22:23:26 +00:00
Jenkins
656490a01d Merge "Pep8 unit test modules w/ <= 10 violations (5 of 12)" 2013年09月04日 21:15:03 +00:00
Peter Portante
9cdee330fb Refactor finalize_put as an object method
Change-Id: Iec3f53c564505c29739bb5531a71a0a101f64193
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月04日 09:21:43 -04:00
Peter Portante
aae122dd4c Rename param to avoid use of built-in name hash
Change-Id: I505e8b15ca41c52cd4942a0a7dd34996a1849bb3
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月03日 22:31:30 -04:00
Jenkins
f2ca932b07 Merge "Fix changes in XML that broke old clients" 2013年09月03日 21:10:53 +00:00
Jenkins
1e05fa64cd Merge "Pep8 unit test modules for hacking and one liners (4 of 12)" 2013年09月03日 20:34:12 +00:00
Jenkins
76e087925a Merge "Pep8 the functionalnosetests tests (3 of 12)" 2013年09月03日 20:04:54 +00:00
Jenkins
c259b43de1 Merge "Always format messages sent to FakeLogger" 2013年09月03日 19:58:57 +00:00
Jenkins
6abb122bb4 Merge "Fix string format error in DiskFile close" 2013年09月03日 19:58:41 +00:00