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
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
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
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
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>
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
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>
- Remove duplicate account_audit call that happened once an hour when stats
where reported.
- And fixed a flake8 complaint
Change-Id: Ide686c475f8648664e9cffdd696629cf6ba9f75c
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>