Commit Graph

3049 Commits

Author SHA1 Message Date
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
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
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
Jenkins
43a1ac6945 Merge "Pep8 the functional tests (2 of 12)" 2013-09-03 19:56:01 +00:00
Jenkins
4b4270f084 Merge "Made the HTTP comparisons slightly more idiomatic" 2013-09-03 19:25:57 +00:00
Jenkins
d658e9e3a0 Merge "Only set PYTHON_EGG_CACHE if it isn't already set" 2013-09-03 18:55:56 +00:00
Alex Gaynor
8d614eeb4a Made the HTTP comparisons slightly more idiomatic
This way they are more obviously range tests

Change-Id: Ia782a8f5ddb5958f9da828e2caadf0a8e3c3ff11
2013-09-03 10:47:06 -07:00