Implement import/export for SolidFire Driver

This adds the import/export (or manage) functioniality
to the SolidFire driver.

Partially Implements: blueprint add-export-import-volumes

Change-Id: I4e7d5fc7c66d8037f01efc47a4cf5e93d9dba662
Update ref used for notifications

When we update a snapshot status in the db, we need to
use the newly updated snapshot-ref object in the following
notification method call.  Otherwise we're sending a
notifciation message with the old/outdated status
information.

NOTE: This also fixes the unit test that was written to
pass with the bug that existed in the notification.

Closes-Bug: #1349805

Change-Id: I32b86d7edd836310c6da7adffa46e915361668f0
fix atom link in XML Version API

This patch fixes tag names where the tag name has ':'
for links templates.
Some examples are
'{http://www.w3.org/2005/Atom}link'
should be
['{http://www.w3.org/2005/Atom}link']

and

'test1:test2'
should be
['test1', 'test2']

Closes-Bug: #1311243
Change-Id: I6e7c068e41eb6b069c24ef9d6c46b726ea722074
VMware:Support for attaching disk to backing

This change adds support for attaching a virtual disk to an existing
backing VM. Currently volume creation from preallocated/sparse image doesn't
honour the disk type in the volume extra spec and adapter type in the image
meta-data. The workflow to address these issues requires the above mentioned
method. This change also sets the disk size of backing to at least 1MB which
is the minimum required by VIM APIs.

Closes-Bug: #1340315
Partial-Bug: #1284284
Partial-Bug: #1287185
Partial-Bug: #1287176

Change-Id: Icdb1f26d5c8eaa42408a14c57c7394d96dda078f
VMware:Disk type conversion during clone backing

This patch adds support for converting virtual disk provisioning
type during clone backing operation. Currently volume creation from
preallocated/sparse image doesn't honour the disk type property in
the volume extra spec. The workflow to address this issue requires
disk provisioning type conversion during clone.

Partial-Bug: #1287176
Partial-Bug: #1287185

Change-Id: Ie493768445b838d3e9447edb76d9845e972bc7c3
Enable checks for E711, E712 and E713

* E711 comparison to None should be 'if cond is None:'
* E712 comparison to True should be 'if cond is True:' or 'if cond:'
* E713 test for membership should be 'not in'

Change-Id: I1481209a85fa6db0343d0111e2b19d9fab4538a7
VMware: Volume from non-streamOptimized image

Volume creation from non-streamOptimized images (preallocated/thin/sparse)
has following problems:

1) Sparse vmdk image is not converted to appropriate virtual disk type
   suitable for attaching to a nova instance.
2) The adapter type in image meta-data is ignored while creating volumes.
3) The vmware:vmdk_type extra_spec property is ignored.
4) Virtual disk extent operation is called with a wrong parameter which
   might result in unwanted disk provisioning type conversion.

This patch fixes the first 3 problems using the following workflow:

a) Create a disk-less backing.
b) Create a virtual disk (single flat extent) from the non-streamOptimized
   image
c) Attach the virtual disk to the backing
d) Clone the backing (if needed) to perform disk provisioning type conversion

Closes-Bug: #1287176
Closes-Bug: #1287185
Closes-Bug: #1284284
Change-Id: Ib7e9fae81d69d2fe490a4b603337f3d5cee1138c
VMware: Update default task_poll_interval value

The task_poll_interval option is used as the polling interval of vCenter/ESX
task status. This patch updates the default value to 0.5s in order to reduce
the wait time for task completion. Similar change has been done in nova and
this change is needed to keep the driver config values consistent.

DocImpact
   Updated default value of task_poll_interval to 0.5 seconds.

Change-Id: I66b80c629e255d61047592455ca42632f93051b2
Closes-bug: #1278028
Fix unit test test_import_record_with_verify

The test case test_import_record_with_verify is intended to call a
backup service class with a defined verify function. This verify
function wasn't overloaded by the fake service.

Change-Id: Ib5738e9c463856dd71a47717b7abb8dff785b3b1
Closes-bug: #1350699
Fixes wrong usage of mock.assert_not_called()

There is no method assert_not_called in mock, use
assertFalse(mock.called) instead of that.

Change-Id: I1b37c49e0a624de42d89890b44458ec6bd4239ee
Fix snapshot id for snapshot_destroy

The id passed to snapshot_destroy should be snapshot['id'],
not volume['id'].

CCLA SCHEDULE B SUBMISSION

Change-Id: I1d84f1d596ebf014c0e3ea4202902ff515b3172a
Closes-Bug: 1351997
Improve regex for _ import hacking check

Commit 3e2b1117 added a check to make sure that the _
function was being explicitly imported so that translation would
work properly.

I have discovered that those regexes/code would not work in some cases.
Particularly if the import line imported multiple things from
gettextutils or i18n.  Also the check being used to find lines using
the _ function was not right.

This commit fixes the issues and adds appropriate tests.  It also
adds the hacking check to HACKING.rst which should have been done the
first time around.

Change-Id: I7227bb0051836e537bff2f0f97662c06452d5af6
Fixing LeftHand live migration error

Fixed a bug in the LeftHand driver that was causing an error to occur during
live migration of an instance that is attached to a volume. The solution was
to make sure server access is only requested for a volume if the iSCSI
session doesn't already have access enabled on the LeftHand backend.

Change-Id: I41046beb66f2a6138659ec3e4d1d3f37b37859b8
Closes-Bug: 1311350
Do not translate debug messages

LOG.debug messages do not need to be translated. The rdb driver
has a couple of debug messages that are translated. This patch
removes those debug translations.

Also, logging exception.ImageUnacceptable can contain non-ascii
characters. This patch fixes this by using six.text_type to
properly translate the exception.

Change-Id: I4ed36173f42b7bf487463f148ae94bd061f6bebb
Merge "VMware:Support for attaching disk to backing"
Merge "VMware:Disk type conversion during clone backing"
EMC: Fix minor issue in VNX driver and unit tests

There were some minor issues in initial commit of VNX Direct Driver
Juno Update (https://review.openstack.org/#/c/104413/), such as typo,
unclear config option help message and missing period.

This change fix these issues.

Change-Id: I82bac9695c8138cff858013b3affeb0557dfcc02
Closes-Bug: #1354272
Merge "Fixing LeftHand live migration error"
Add CHAP support for 3PAR ISCSI

Adds CHAP support to 3PAR ISCSI.  Volume metadata will store
CHAP credentials to allow volumes to be attached to hosts on
a 3PAR backend.  Credentials are generated when the first volume
is attached.  Subsequent volumes lookup the CHAP credentials
from an existing volume already attached to the host.

Implements: blueprint add-chap-support-3par-iscsi
DocImpact

Change-Id: I45d77c4243339e8fc76969042634c6c45899fbae
Merge "Improve regex for _ import hacking check"