Fix NovaObject versioning attribute usage

A typo made early in the object prototyping process has meant that
all objects thus far have been exposing a version of '1.0' because
the base object has been using an attribute of 'version'. The
object implementations have been exposing a 'VERSION' attribute
with their desired version advertisement.

Since we are still relatively early in the process of deploying
objects, the impact from this should be relatively minor, although
it is important to get this fixed ASAP before any incompatible
object changes are made.

(cherry picked from commit 99cbfb3492c80ded53fa018fe5a0881f977dc407)

Change-Id: If9154dc663111f304f72ef7f6f37c465e84ff504
Closes-bug: #1239709
Update six dependency

The version of six specified in nova's requirements list
conflicts with the version used by the python-keystoneclient
requirement. This change updates the settings for six so
they match.

Change-Id: I3082090f5d3849a7fbebf515c3d743cd8c3e9c43
Open stable/havana

Change-Id: I1f59561b357c03866672c2d9576568a67630a033
Merge "Fix NovaObject versioning attribute usage" into stable/havana
Merge "Open stable/havana" into stable/havana
Fixes datastore selection bug

Currently the vmwareapi drivers will only select the first
available datastore it finds, even when there are other
datastores with capacity, it will fill one datastore completely
and then die.

Closes-bug: 1227825

Change-Id: I24f85114ea3f014950c27c0c91a6be352990d263
(cherry picked from commit 6c4b89a2ad51f92707acc01908b63bc507ad8fe7)
Fixes Invalid tag name error when using k:v tagname

This patch fixes the invalid tag name error when k:v type
tagname appears in response of api during xml serialization,
the tagname which contains colon couldn't be supported by
default since it is reserved by xml namespace, this patch
solve it by adding the k of k:v tagname into namespace.

Fixes bug: #1213927

Change-Id: Ib20efb378425cbe5deef45fbac561955cbe0f7bc
(cherry picked from commit 80b11279ba9853a9ab743ec6987c3229fff0b5e4)
VMware: fix regression attaching iscsi cinder volumes

VMware drivers fail to attach a iSCSI backed cinder volume with an
error 'unable to find iscsi targets' because the underlying
retrieval api was updated to a newer version but not it's usage in
volume_util (see commit e331287cdd1300878bfb9bbb3630889370e5fa72).
This is a regression over Grizzly release.

Fixes: bug #1193980

(cherry picked from commit e70211ff89785fed6a868eaab723847833590502)

Change-Id: I14fe62ad98fd9161df3ce6c06160b2759a9e38b2
Fixes inconsistency in flavors list with marker

Flavors list with marker is supposed to use flavorid as the marker since this is
the only id attribute the users can see, but it was using id (the confusion was
probably caused by the fact that flavorid attribute shows up to the user as id).

The change on db unit test shows makes the bug evident, and justify the changes
on the filter_by criteria.

Fixes bug 1226698

Change-Id: I3ffa636febb63be796fffc94be6486bf74e8239b
(cherry picked from commit c2c0958ad768581cd0e92f88207430227cb6539a)
Fixes unicode issue in the Hyper-V driver

The XML string returned by the WMI API calls requires unicode
conversion before further processing, e.g. with ElementTree.

This affects the vhdutilsv2._get_vhd_info_xml method due to
the textual description. The issue came to light using the
host with Chinese locale, while not present on a en_US host.

Fixes bug: #1229671

Change-Id: I09435a205abfc8ae9470c53c5446cbb28dee0115
(cherry picked from commit c8c7c01d68b34b76ebe6c4b39f93915480c1ccea)
hyperv: Initialize target_iqn in attach_volume

The target_iqn is referenced before it is declared in the
case that an exception is encountered in _login_storage_target
or _get_mounted_disk_from_lun.  This causes the exception path
to cause an additional, misleading, traceback to be printed
after an exception is encountered.

This commit initializes target_iqn at the beginning of
attach_volume to avoid the traceback.

Closes-Bug: 1233837
Change-Id: I1cdfb9dfa054ee4f4f6918d7bc49081ccaebab9d
(cherry picked from commit 9baa186ebb578205c513c94fc621e254f4c13a08)
Merge "Fixes inconsistency in flavors list with marker" into stable/havana
Merge "Fixes unicode issue in the Hyper-V driver" into stable/havana
VMware: fix bug with booting from volumes

When booting from a volume without an image reference would cause
an exception.

Change-Id: Ib0302197b8d4f5e054a8c4426cb0dde7cb82842e
Closes-bug: #1235022
(cherry picked from commit 026843773b71ab0ac30abb36fe9eed92f5e11f7a)
Remove unnecessary "LOG.error()" statement

Removes apparent debug statement left in from
Ifd41886b9bc7dff01cdf741a833946bed1bdddc

Closes-Bug: #1239603
Change-Id: I9c5b9a6b2349a6c62bef2974ab3b0bb986533741
(cherry picked from commit 7ef98b44374945cd157b125a9b46ee5727d285fe)
Add notification on deleting instance without host

If an instance which does not have a host associated is deleted, the
corresponding notifications were not being sent. Fixed the issue.

Closes-Bug: #1211742

Change-Id: I56482ab38725e6f1ddfb14350637d329f35095b3
(cherry picked from commit bbab55c4da531e4695a6e3e577aaa4975f0fce79)
Cells: Fix instance deletes

A regression was introduced with object conversion that caused all
instances to be locally deleted in the API cell when cells is enabled.
This would happen before the child cell was told to delete the instance.

Additionally, if an instance record was created in a child cell but
failed to schedule to a host in such a way that the API cell has
no knowledge of the 'host', the instance would be deleted in the API
cell only.

Also, it appears that we would cast deletes to child cells twice due to
logic duplicated in cells_api.py that exists in api.py.

Closes-Bug: #1240247

Change-Id: I94cfddd9cef2d63b2cb31c0f2dae8e211a4418d9
(cherry picked from commit 0493c803ae9612f87ed028e1a39e880aead5bdcb)
Fail quickly if file injection for boot volume

Previously if the user attempted file injection on a booted volume it
would fail and retry several times, which slowed down the instance
spawning.  Instead of attempting file injection, fail quickly, and
log a warning

Fix bug 1188543

Change-Id: I264540de736c2bcb92567826fe5ba672e1244ba2
(cherry picked from commit f59c2d64ac8f0523c587e23b2d1c59fdfe7ea131)
Pass volume_api to get_encryption_metadata

The module encryptors was creating a volume API instance in the module
scope which caused all the modules importing it to depend on
cinderclient.

This was affecting scheduler and cert services which at some point import
the compute manager module only to access their config options. It makes
no sense to force scheduler and cert services to require cinderclient.

This patch makes the callers of get_encryption_metadata to pass the
volume api object to this method to prevent this dependency.

Closes-Bug: #1246103
Change-Id: I9eb4ae3754fa2a5ac646560a62477d6ed672e272
(cherry picked from commit a3aeace9afd5c533f040452f33482fdb55d93927)
Fix getting nwinfo for Instance obj

This fixes the get_nw_info_for_instance() method in nova/compute/utils.

If an instance object has no 'info_cache' (means we lack an entry in the
instance_info_caches table for the instance), don't try to access the
'network_info' attribute.  Just return a network model with empty
networking information like the dict version of an instance would do.

Change-Id: Ib1f49f10cefeefc55a87fea69b6fbc772c978dca
Closes-bug: 1243291
(cherry picked from commit a907c2f06b65dca7c2c0ea6119fe649864c6de11)