Fixes the 3PAR drivers CPG validation

The 3PAR drivers were not checking if the Common Provisioning
Group(CPG) exists in the virtual domain at volume create time when
the default was being overwritten by volume type extra_specs value.
It was also reporting the default CPG in the metadata returning
after creating the volume. Now it reporting the correct CPG and
setting the correct snapshot cpg if different from the default
or not set.

Fixes bug 1186427

Change-Id: Idef7a4f29854c82980789786f2414e5046c8d8fb
Fix 'Inheritance-based rule deprecated' log warning

A warning message appears in Cinder logs which state that
inheritance-based rules are deprecated and use default
Brain instead of HttpBrain. It looks like HttpBrain class
doesnt have any difference from Brain class, so changing
all the instances of HttpBrain to Brain shouldn't affect
anything and removes this warning from logs.

Digging further, I found out that the policy engine has
gone through a major rework in Oslo and Nova, and I think
at some point of time in future, we will also be moving
to use the latest policy engine code. In that way of
thinking, I guess this fix is acceptable for now.
Reference: https://review.openstack.org/#/c/14122

Changed the brain from HttpBrain -> Brain, which makes the
warnings in the log disapper. A more comprehensive work will be
to pull the latest policy change code from Oslo.

Bug #1156608

Change-Id: I9f63ec4c41025042725db9b2e7c8ffa3d91e0596
Update cloned volumes QoS settings.

The SolidFire device inherits all settings (including QoS) from
the parent on a clone.  This meant that although we were expecting
QoS to be updated when a clone was issued with a different Volume
Type than the parent volume it was never acted upon.

This change fixes that bug by simply adding the *new* qos settings
to the ModifyVolume call after cloning.

Fixes bug: 1184235

Change-Id: I81786a07312027d543b9f06e54dfbf57e6085bc9
Don't set signing_dir by default.

Allow the auth_token middleware to setup its own signing_dir
if required.

Fixes LP Bug #1185098.

Change-Id: Id8766efb34d37ca382b865167ec2465d0a1ce8dc
rbd: send ceph monitor addresses with connection info

Previously we relied on a ceph configuration file on the compute host
for this information. Sending the info directly from cinder makes more
complex setups with multiple ceph clusters talking to the same compute
hosts possible.

Refresh the monitor addresses for each initialize_connection() call,
since monitors may be added or removed while cinder-volume is
running.

Fixes: bug 1077817
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>

Change-Id: I34a1fa16ce1f4524ba25832faf3129303e755100
test_glance.py: Stub out _get_member_model as well.

glanceclient's v2 client needs to also have its _get_member_model()
stubbed out as well, to avoid attempts to reach 'fake_host' during
client instantiation.

Update: Only stub when _get_member_model() when required.

Change-Id: I943cbb017ccdbe4f6c994bc83cbefe8693f4672b
Fixes: bug #1185178.
Merge "Update cloned volumes QoS settings."
Catch and report errors from copy image to volume.

The copy image-to-volume errors weren't being handled
properly and the result was the lvcreate being retried
even though the lvcreate itself succeeded.

The result of this was misleading errors stating that
the volume couldn't be created because it already existed
(which it did, becuase the create itself was succesful).

Fixes bug: 1183283

Change-Id: I23f05fe64475c3efe285e05a258c4625b801375c
Migrate to Oslo DB code

 - engine and session handling code is reused
 - integrity errors caused by duplicating entries
   are handled properly
 - the base class for models is mostly reused
   (the only exception is SoftDeleteMixin, which
    requires changes to existing DB schema; this
    will be implemented in BP db-unique-keys)
 - use common exceptions handling code

Blueprint: db-session-cleanup

Change-Id: I7f5eb53daddc57066af9c73caa633b37a2afd9c2
Remove execute permissions from test files.

Remove execute permissions from test_volumes.py and
test_storwize_svc.py, which caused the tests defined in them
to be skipped.

Fixing the permissions caused test_create_volume_with_volume_type to
execute, which fails. The cause of the failure is that
(1) LoggingVolumeDriver doesn't implement get_volume_stats(), and
(2) The fake RPC doesn't pass the statistics to the scheduler for
some reason.

Because this test doesn't test the scheduler, just change to use the
simple scheduler and work around the issue.

Change-Id: Ie01331d484c5c48c78b626eff1ad793dbbe7182c
Fixes: bug 1183416
Add missing tests for cinder.db.api

Methods covered:

 reservation_*
 service_*
 volume_*

blueprint db-api-tests

Change-Id: Ieb396b3de40eaa2fca9d285f75c0a3d631745e74
Merge "Remove execute permissions from test files."
Ensure that pbr>=0.5.10 is installed

A bug in PBR levels less than 0.5.10 causes the
/usr/lib/python2.X/site-packages/cinder/db/sqlalchemy/migrate_repo/migrate.cfg
file to not be properly installed.  This causes 'cinder-manage db sync'
to fail due to the missing file.

This change sets the required PBR level to >=0.5.10,<0.6 to avoid the problem.
In the case that user already has a 0.5.X level of PBR installed that is less
than 0.5.10 it should be updated rather than encountering issues as our
test system did.

Change-Id: I532158277a4acbb2f8cb75d03c91097e6d7e0312
fixes: bug 1182203
Fixes 3PAR Host already exists error.

Fixed “Host already exists” error by,
* Screen scraping error message and extracting the host name
used by the 3PAR backend.
* Cache the host name used by the 3PAR backend for subsequent
methods using host name.
* After a restart, and 3PAR host name it no longer available,
retrieve 3PAR host name using wwn/iqn, if a terminate_connection
fails.

Fixes bug 1182134

Change-Id: Ia08a311af168ae19dbe7c1405db9c606fd878e53
Support for NFS shares with spaces in path.

Unescape share address string listed in nfs_shares_config so that
'x.y.z.w:/foo\040bar' would become 'x.y.z.w:/foo bar' to support
mounting shares with spaces in name.
Use stat command to get available and total space on device instead
of df since it's output is easier to parse.

Fixes: bug #1180984
Change-Id: I552aba91ca8db14130f854c739594a818186bbe2
Merge "test_glance.py: Stub out _get_member_model as well."
Imported Translations from Transifex

Change-Id: Ia0a6aa414a71f25baa1555dc004340e7b29c0f20
Merge "Ensure that pbr>=0.5.10 is installed"
Merge "rbd: send ceph monitor addresses with connection info"
Merge "Fixes 3PAR Host already exists error."