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
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: 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
Ignore HTTP_PROXY during test requests

urllib2 follows http_proxy/HTTP_PROXY by default.  If a (non-local)
proxy is set and a test tries to connect to localhost:$port, it will
instead attempt to connect to $port on the proxy and (presumably) fail.

This change forces the two tests that failed in the presence of
HTTP_PROXY to connect directly.

Change-Id: Ia12c91b356f0ccebf874933ff459aa2faa190655
VMware: Check snapshot and rename backing

This patch adds methods for: a) checking existence of backing VM snapshots;
and b) rename backing.

Change-Id: Iede168e28d9569a5a3331479c8096c3cca5140e9
Partial-Bug: #1275682
Implements: blueprint vmdk-backup
Prevent tenant viewing volumes owed by another

Bug introduced by 0505bb268942534ad5d6ecd5e34a4d9b0e7f5c04 allows any
tenant to get the details of a volume belonging to any other tenant
if the UUID is known.

This commit allows only the tenant or an admin to get a volume.

Change-Id: I0268d374f7529d89068dcbf3c1cb9ab3d60d4115
Closes-Bug: #1356368
Enable F402 checks and fix violations

This change enables F402 hacking check and fixes all violations found.

[F402] import module from line N shadowed by loop variable

Basically this rule tries to avoid loop variables using the same name as
imported module, for example:

    from cinder import volume
    ...

    for volume in volumes:
        ...

Change-Id: Ie3010616ca87fda113d452fe684e6cff3d5fd978
Sync latest oslo-incubator log for debug fixes

This patch pulls in the changes in openstack/common/log.py that
fix the problems that popped up after we removed _() from
around LOG.debug messages.  The change in log ensures that any
text that is not of six.text_type is converted to six.text_type.

Current HEAD in OSLO:
---------------------
commit 759bd8791ec6a4b0e89f649a4179d177530e7536
Merge: 71d072f 631f880
Author: Jenkins <jenkins@review.openstack.org>
Date:   Wed Aug 13 13:37:27 2014 +0000

Merge "Set keystonemiddleware and routes.middleware to log on WARN level"
---------------------

Additional changes being merged (newest to oldest):
---------------------
759bd879 -
Merge "Set keystonemiddleware and routes.middleware to log on WARN level
71d072f1 -
Merge "Except socket.error if syslog isn't running"
37c00918 -
Add unicode coercion of logged messages to ContextFormatter
66144135 -
Correct coercion of logged message to unicode
1188d88a -
Except socket.error if syslog isn't running
ac995bec -
Fix E126 pep8 errors

Note that this change required an update to config.sample due to change
759bd879 -  Merge "Set keystonemiddleware and routes.middleware to log
on WARN level"

Change-Id: I4b849981c65300b327076d68fbf8601d46ec61f0
Closes-Bug: 1348244
Actually encode the SolidFire json dump result

The SolidFire driver intends to do a encode on the json data to utf-8,
unfortunatly it's not really doing anything because the syntax of the
calls is wrong.

This patch changes things to actually perform the encoding.

Change-Id: I2bc94ed1fdc1dd5f9a6371ae5f63a955f213bc15
Closes-Bug: #1355622
Merge "Enable F402 checks and fix violations"
Merge "Actually encode the SolidFire json dump result"
Enable import group hacking rule

This change enables H305, H307 included in newly updated hacking 0.9
all violations are fixed.

H305, H307 will check if imports are grouped in stdlib, 3rd libs and
OpenStack components.

Change-Id: I612cae64982450a9be5207dbe26a2b52da49dac6
Merge "VMware: Check snapshot and rename backing"
Merge "Enable import group hacking rule"
Catch DBDuplicateEntry instead of IntegrityError

'iscsi_target_create_safe' method didn't catch DB exceptions
correct.

Need to catch both db_exc.DBError and db_exc.DBDuplicateEntry
due to current oslo.db limitations: it doesn't handle correct
DBDuplicateEntry with different SQLite versions

Related-Bug: #1187367

Change-Id: Ie412ecabd3cbcac301340c82b4275adb7a7206c3
Merge "Sync latest oslo-incubator log for debug fixes"
Merge "Fix unit test test_import_record_with_verify"
Fix exception handling in PureISCSIDriver

PureISCSIDriver had some error logging messages that make use of empty
replacement fields "{}" in strings on which the .format() method is
called, as allowed in Python 2.7+. Python 2.6 requires explicitly
naming or enumerating fields, i.e., "{}" must be replaced with "{0}".
This change fixes this so PureISCSIDriver is Python 2.6 compatible.

PureISCSIDriver.terminate_connection() also changed to catch
errors raised by _get_host_name(). Exception handling generally changed
to be more correct.

This change also adds testing of these code path to the unit tests,
to make sure it's actually correct.

Change-Id: I84179a8bc59dcf5593664ab11c90b07c451fd360
Closes-Bug: 1357004