To fixes import error for run_tests.sh

Change-Id: Iacce978001750c9cb8f398dba78361dee22ed2fb
Closes-bug: #1314007
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Bump python-swiftclient version

https://review.openstack.org/#/c/69187/ introduced SSL certificate checking
in python-swiftclient (released as v2.0). This patch ensures that the version
of swiftclient used will verify SSL certificates correctly.

This patch also documents the `swift_store_auth_insecure` configuration
option for bypassing the cert verification

DocImpact
SecurityImpact

Change-Id: I20ddab5c3359071daf7505268c72331e4c786987
Use df(1) in a portable way

The _get_capacity_info() method of glance.store.filesystem.Store
class calls df(1) with '--block-size' GNU-speicifc argument
to get 1 byte blocks.

To make this code more portable [1], call df(1) with '-k' argument to
get 1024 byte blocks and multiply the result by 1024.

1: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/df.html

Change-Id: I7ab2eb1c8588fec3623046ddc91615ba2eba2c13
Assign local variable in api.v2.image_data

If local variable 'image' will be not initialized we get UnboundLocalError
while handle following exceptions:
exception.StorageFull
exception.StorageQuotaFull
exception.ImageSizeLimitExceeded
exception.StorageWriteDenied
webob.exc.HTTPError
ValueError

This is because not initialized variable 'image' used as argument of
method _restore. That is why we should initialize it.

Closes-Bug: #1310952

Change-Id: I3bf73ca272aad479416067495006476934a01dd9
colorizer: use staticmethod rather than classmethod

The methods are actually not class methods at all as they do not use the
class nor the instance.

Change-Id: I04721bcaef30da291389a1144bdcfe65f10753b2
notifier: simply notifier_strategy compat support

In order to handle the deprecated notifier_strategy configuration option
we just need to translate the notifier_strategy value as follows:

  default -> transport_url=None, driver='noop'
  noop -> transport_url=None, driver='noop'
  logging -> transport_url=None, driver='log'
  rabbit -> transport_url=rabbit:///, driver='messaging'
  qpid -> transport_url=qpid:///, driver='messaging'
  None -> transport_url=None, driver=None

where the last bit simply means that the user hasn't specified any
notifier_strategy and we should just have oslo.messaging load a notifier
based on oslo.messaging's config options.

It really doesn't need to be any more complicated than that, and we
certainly shouldn't need to poke at what the user may have configured
for transport_url in their config file.

The reason this is important is that CONF.transport_url is a private
configuration option which soon will not be visible to users of the
oslo.messaging API. See I9c3bf74f13a820ce295aa77a2bbcd781778b5926.

Also, simplify the testing of this stuff by mocking the oslo.messaging
APIs used and using the test scenarios outlined above. This also means
we stop poking around in oslo.messaging internals like:

       self.assertEqual(str(nfier._transport._driver._url),
                        'qpid:///')

Naughty, naughty!

Note: it's arguable we should just remove notifier_strategy in Juno
since we deprecated it in Icehouse, but this patch will be useful to
backport to stable/icehouse in any case.

Change-Id: I067248974baee50a2a0afb38bf022b65d1bea57a
notifier: remove notifier_strategy compat support

The notifier_strategy option is deprecated since we merged commit
I8cd84772bc5867e06b2a50ed7e15b9e86f0b94ad during the Icehouse cycle.

Assuming the usual single cycle deprecation period, this can now be
removed.

DocImpact: the notifier_strategy has been removed in favor of the
notification_driver and related oslo.messaging options.

Change-Id: I3ab0133b697a820536e5da84e30b078915a29f6c
Merge "To fixes import error for run_tests.sh"
Move `location`'s domain code out of glance.store

This patch moves the location domain's specific code out of
glance.store. Since this code is Glance specific, it's necessary to move
it out of the store package so that we can then remove it all together
and use the `glance.store` library.

Partially-Implements blueprint: create-store-package

Change-Id: I7dc3d5d211054cabc2adc2b9b689cda11bce2190
Merge "Bump python-swiftclient version"
Merge "Move `location`'s domain code out of glance.store"
Do not call configure several times at startup

At startup, Glance first creates the stores and then verifies
the default store. Each of these operations will indirectly
trigger the creation of store objects which is triggering configure
and configure_add calls.
configure and configure_add can potentially contain remote calls
going through the network: we should avoid having these methods
called two times for nothing.

This patch adds a parameter in the store init method to specify
if the configuration of the store should happen. In case of verify
default store, the configuration should not happen.

Closes-Bug: #1315237

Change-Id: I329730a3351cd7b78de27a88a7f669ae32b2f100
Fixes v2 return status on unauthorized download

If a user is not allowed to download an image because of a policy,
glance v2 API responds with a  HTTP 200 status and no data instead
of HTTP 403 for no cache only.
The problem is that get_data implementation for notification
proxy is a generator, this situation delays the other proxies
get_data calls (including the policy proxy) for the first time
data is retrieved.
Hence, there is a delay in enforcing policy, so 200 is sent before
the API gets the chance to catch the policy exception.

DocImpact
Closes-Bug: #1326781
Change-Id: I1e50a069a6b7f9eed7160cd5908a5fa30274e227
Merge "notifier: simply notifier_strategy compat support"
Merge "Fixes v2 return status on unauthorized download"
Add pluging sample for glance gate

Recently we add support for plugins in gates, so now you are able
to keep rally benchmarks in your source tree. It may be usefull in cases
when you would like to check/debug in gates with benchmark that doens't exist
in Rally but don't want to spend whole life to get in Rally source.

As well we add extra/ directory that is just copy pasted in gates.
So we can use absolute path in task configs, cause this directory
will be copy pasted to ~/.rally/extra. This may be super usefull if you
would like to test infrastracture on scale, creating images from empty files.

Change-Id: I759ee8bf7a930169afd6076ec96f8fe3a3692866
Changed psutil dep. to match global requirements

Global requirements now expect that psutil<2.0.0
Therefore the call to children() in psutil was
invalid and was failing tests, so this commit
changes the call to get_children() and updates
test-requirements to reflect this version change

Change-Id: I9570dd1ec0cb9fd7efaee292d7996510b56ab611
Merge "Changed psutil dep. to match global requirements"
Updated from global requirements

Change-Id: Id99428645bdc0406071e149b92ea2541587617c2
Merge "Use df(1) in a portable way"