Remove unused import of oslo.config

Remove unused import in glance.cmd.cache*,
and make glance code tidy and pleasing.

Change-Id: Ie5d2cf5c1a52fda505a1dd4d5b01267285a10c00
test failure induced by reading system config file

run run_tests.sh or tox to test the glance code, it will get
following failure:
test_get_bind_addr_default_value
test_get_path_non_exist

Analysis
--------
The root cause is resided in "glance/tests/unit/api/test_cmd.py".
In TestGlanceApiCmd.setUp, the sys.argv is overrided to ['glance-api'].
Since sys.argv is "global" variable, and this test entry it run
firstly by nosetests while running tests in "glance/tests/unit"(since
nosetests search test items alphabetically), the other test entries
will inherit the sys.argv value ['glance-api']. Finally the system
config file "/etc/glance/glance-api.conf" is read in "setUp" via
oslo.config.cfg:ConfigOpts.__call__ -> _pre_setup -> find_config_files.
CONF.bind_port and CONF.bind_host is set to the value reading from
system config file: /etc/glance/glance-api.conf.

A simplied call backtrace:
TestGlanceApiCmd.setUp -->  sys.argv = ['glance-api']
 ->JSONRequestDeserializerTest.setUp
  ->glance/common/config.py:parse_args
   ->oslo.config.cfg:ConfigOpts.__call__
    ->CONF.bind_port CONF.bind_host is set

wsgi.get_bind_addr() will read the CONF.bind_port and CONF.bind_host
to return value. if system config file is not read, CONF.bind_host
is set to "0.0.0.0", CONF.bind_port is not set. wsgi.get_bind_addr()
will return the expected value. This is the reason that individual
test of test_get_bind_addr_default_value got passed, but failed while
testing all.

The failure of test_get_path_non_exist is induced by same reason.

Test case should clear up the setting in tearDown(), especially the
"global" setting, e.g. sys.argv.

Solution
--------
The solution is simple:
In class TestGlanceApiCmd, add a private variable to backup the
sys.argv in setUp(), and restore it in tearDown().

Test method
-----------
$ ./run_tests.sh

$ tox -evenv -- nosetests \
--tests=glance.tests.unit.common.test_config:TestPasteApp

tox -evenv -- nosetests
--tests=glance.tests.unit.common.test_wsgi:JSONRequestDeserializerTest

Fixes Bug #1204186

Change-Id: I2dac8e506fa794d1faa9509258936d78e2f981d8
Fix Sphinx warning

Title underline was too short.

Change-Id: I2915f9d3ad0b208286d447ef2375e51f51b7e35d
Add a storage quota

This patch adds a storage quota that is applied against the sum total
of a users storage consumption against all configured storage systems.
A single quota is applied to all users via the configuration option
'total_storage_quota'.  Most of the patch is about enforcement so
when a separate service for quota management emerges in OpenStack the
per user value to enforce can be obtained from that service but the
enforcement code will remain the same.

blueprint glance-basic-quotas
docImpact
Change-Id: I251832f7372c70942be6f0c6aa12285145dd7c18
Show traceback info if a functional test fails

Fixes bug 1218277

Change-Id: I2d1cb7f5748dba203f72f2996c2228f7bfed7987
Merge "Add a storage quota"
Clean up data when store receiving image occurs error

Clean up already received data from backend store to prevent potential
leaking when driver receiving image occurs error such as
ImageSizeLimitExceeded exception.

Fixes bug: 1214276

Change-Id: Ice1de4d1c61a62fff778acbbeb9bc27d03ed7ab4
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Merge "Remove unused import of oslo.config"
Merge "Fix Sphinx warning"
Merge "test failure induced by reading system config file"
Scrubber refactoring

* Adding multiple locations image support.
* Adding lock protection to prevent race condition between glance-api
and glance-scrubber service.
* Refactoring scrub queue code.

Implement bp: glance-scrubber-refactoring
docImpact

Change-Id: I050ff212d73ace8e84dcd800245b608210d6b29a
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Merge "Clean up data when store receiving image occurs error"
Merge "Show traceback info if a functional test fails"