Added unit test cases for _is_share_eligible in NFS driver.

The generic NFS driver (under cinder/volume/drivers/nfs.py) has
a method called _is_share_eligible, which checks if a given NFS
share meet user specified conditions, such as:
  1. The ratio of actual space (used_space / total_space) is
     less than 'nfs_used_ratio'.
  2. There is enough space is available for the new volume.
This patch adds the corresponding unit test case for it.

Change-Id: I4489cbbca0a1a75a1144a87628843baf0a92f8a8
Closes-Bug: #1298414
vmware: Fix problems with VIM API retry logic

Currently the VIM APIs including session creation API are retried for
cases which are unrelated to connection or session overload problems.
This change fix the retry logic as follows:
* Add an exception to indicate connection problem and raise it
  appropriately from the VIM API client
* Modify the expected exceptions in the retry decorator to include
  only connection and session overload related exceptions

This change also fixes the base class of VimFaultException
(VolumeBackendAPIException -> VimException). This change is required
so that we can handle the exceptions thrown by the VIM API client in
a consistent manner. Currently if we need to handle VIM API related
exceptions, we have to catch both VimException and VimFaultException.
For example, the API for checking active session raises
VimFaultException in some cases and we are handling only VimException.
Due to this, when session expires, the session re-establishment and API
retry fails (intermittently) since the check for active session throws
VimFaultException in some cases which is not handled.

Change-Id: I72cfc7777c3ce693b8598633f822c12c2cee2235
Closes-Bug: #1294598
Closes-Bug: #1302514
Specify lld in tgt config backends

Otherwise when running tgt-admin --delete, it might forget
to invoke tgtadmn with "--lld iscsi" in order to delete the low-level
iscsi exports, which can cause crashes or hangs later on.

Closes-Bug: #1311640
Change-Id: I436c67c30565089236e987d84ac2609eedd2d2c7
Add rally job

Add rally scenario to be run by OpenStack CI system

Change-Id: Ie305ab51b75cd24e21868b965b9345a4444b2d20
CinderException args to strings when exceptions

CinderException message and kwargs are converted to strings if the
argument is itself an exception.

Exceptions passed as arguments to CinderException happen in many areas
of the code. This causes an error when oslo.messaging tries to serialise
the exception.

Change-Id: I1399c939bbca47ab8362ac3bbe0e9a349c6d5572
Closes-Bug: #1301249
Fix broken version responses

The version responses link to non-existing PDF and WADL files.
Remove the WADL link and replace the PDF link with a HTML link to
docs.openstack.org.

Change-Id: Id514caee32df430b616609144f52d1a58c93d9cd
Closes-Bug: #1313118
Closes-Bug: #1313116
Ensure that lun_id is an int

The map_vol_to_host function was treating the lun number
as a string rather than an int.  This was causing attempts
to mount storwize_svc volumes to Hyper-V nodes to fail as they
were checking an integer type against a unicode type which
would fail.

This change casts result_lun to an integer after the value has
gone through the ssh injection attack check.  This way Hyper-V
is able to verify if the found LUN is the target LUN, enabling
mount of storwize_svc volumes to Hyper-V.

Change-Id: I96d179f2a58e5948c8ba6c9ae618daad7b8d4c86
Closes-bug: 1269915
Remove explicit dependency on amqplib

amqp (or amqplib) is only accessed via kombu, and kombu
already specifies the right dependency (either amqp if new
enough or amqplib for old versions of kombu).

Change-Id: I4efa419db1befdfcbe639a8557e21eb97ca3a26e
NetApp NFS: Do not reference dst_img_local before assignment

This patch moves the assignment of the dst_img_local variable to before the
try/finally block that references it so that the finally block will have this
variable no matter where in the try block an error is raised.

Change-Id: Iab48b46559f18a3d6b044abe4bc3e615e7fee075
Closes-Bug: 1309047
Add exception handling for copy_volume_to_image()

The method require_driver_initialized occurs exception so that the
method volume_get will be not executed, and the variable 'volume'
will be not defined. In the "finally" code segment, the
volume['instance_uuid'] will get the UnboundLocalError, this patch
gets volume before require_driver_initialized to avoid the above
problem.

Change-Id: Ic8167383eb67c5016c9853da274455e0f202dc4d
Closes-Bug: #1322958
Limit formatting routes when adding resources

By default, routes.mapper.Mapper.resource adds a bunch of formatted
routes that accept anything after a '.'. Our spec says only .xml
and .json are accepted so limit the formatting to those valuse.

This allows identifiers with a '.' in urls. A few tests were added
to the extensions test to prove that .xml and .json are stripped
but other values are not.

Closes-bug: #1307956
Change-Id: I8f0b4ae3b10ea93890f6506662905bd5823412f5
Add mailmap entry

Add a mailmap entry to map to my gmail account.

Change-Id: If8cdff519415bd2b7138638746988e6f177c855c
eliminate the need for hp3parclient in tests

In order to eliminate the need to have the hp3parclient in the
global-requirements project, we need to remove the hp3parclient
from being imported in all 3par driver unit tests in cinder.

Closes-Bug: #1315195
Change-Id: Ife5c70871e742be5970be8f0284e12554f93cab4
Fix retyping volume that has volume type None

Modified volume_types_diff to work when one volume type is None.

Fixed _fix_encryption_specs so that the new dictionary is returned.

Change-Id: Iaba3032317f4d0649c917fb92403c4e9146fe3e9
Closes-Bug: #1311058
Merge "Ensure that lun_id is an int"
Fix solaris_execute in SolarisISCSIDriver.

A previous refactor [1] of SolarisISCSIDriver and SanDriver renamed
the `_execute` function to `san_execute`. However, SolarisISCSIDriver
still called the _execute function, which no longer exists in it's
parent classes.

This change calls san_execute instead of _execute in
super(SolarisISCSIDriver, san).

[1] https://review.openstack.org/#/c/38194/

Closes-Bug: #1318108
Change-Id: I4cafefdb3eef8f3c2c345907d7eabd4e8f88ef65
Merge "Remove explicit dependency on amqplib"
Merge "eliminate the need for hp3parclient in tests"
eliminate the need for hplefthandclient in tests

In order to eliminate the need to have the hplefthandclient in the
global-requirements project, we need to remove the hplefthandclient
from being imported in all HP LeftHand driver unit tests in cinder.

Change-Id: I4009ea17b507b1deb2a567dd420f309e15aaf92d
Closes-Bug: #1316824
Convert SolidFire Capacity response to GiB

This patch fixes the reported free_capacity_gb response
in the SolidFire update_cluster_status method.

The initial patch fixed the free_capacity conversion,
however omitted the same fix that was needed for the
free_space calculation.

Closes Bug: #1284452

Change-Id: If034957764911ec92a6d7e603d0510325018db6d