Fix all scripts to honor the enabled_ssl_apis flag

Add logic to allow configuration of SSL for all the cmd scripts
that start a WSGIService

Change-Id: I921013d113081a91a3fe9bb574bae5cd7bb06bcc
Closes-Bug: 1237126
Refactor unit tests code for python3 compatability

The builtin basestring abstract type was removed in python3,
use str instead, we need to using six.string_types to replace
the basestring for py3 compatibility.

Partial Implements bp basestring-py3-compatible

Change-Id: I0f6a0f9ca4e17800407f3c1bbdce11a46288f693
Pull system_metadata for notifications on instance.save()

When saving changes on an instance object a notification is sent out.
An attempt is made to pull flavor information from the instance but if
system_metadata is not joined then an exception is raised and the
notification fails.  This ensures that system_metadata is available for
those notifications.

Change-Id: Ifd317f847c3839cd6019038bb3dc856b9f107000
Closes-bug: 1244311
Remove instance_type* proxy methods from nova.db.api

There were several proxy methods left in nova.db.api to ease the rename
of instance_type to flavor with a note to remove them later.  This
patch does that removal and handles the impacts to the tests.

Part of blueprint flavor-instance-type-dedup

Change-Id: I2dd7a68ea028056996da6ea96a1fe3cae4ad0389
clean up numeric expressions in tests

Replace numeric expressions with constants in nova/tests
to make code more readable.

Implements: blueprint byte-unit-clean

Change-Id: Ic074ab07fa84b32805647201cd5ff433f3e7949c
Add a metadata type validation when creating vm

If specifying non-dict data(string, etc.) as metadata, "create a vm"
API returns a HTTP500(Internal Server Error) response because it does
not validate the metadata type.

This patch adds the metadata type validation, and the API will return
a HTTP400(Bad Request) response. In addition, this patch removes log.WARNs
of bad incoming requests because they are just client-side problems not
server-side.

Closes-Bug: 1238344
Change-Id: I8f1d5debf74891e67b17f8128cc0eb0ab7f5c3f5
xenapi: refactor get_all_vdis_in_sr

Making the code in vm_utils._get_all_vdis_in_sr more consistent with the
code in session.get_all_refs_and_recs.

Rather than catching all exceptions, the session.get_rec explicitly
catches the INVALID_HANDLE exception that xenapi might raise.

Change-Id: Ic69735e1a6caa893f63428141428ee0fd1a3ac65
xenapi: strip base_mirror after live-migrate

There is a bug in XenServer CA-98606 that means you get base_mirror key
left over after a block live-migrate.

This change ensures to strip out that key after error live migrate, to
ensure the key is never left around in a way that means the next live
migrate would fail.

Fixes bug 1234752
Change-Id: Icd6ba17039b50ae20d252d7c052120abe7de0deb
Utilizes assertIsNone and assertIsNotNone - tests/virt

Using assertTrue and the 'is None' operator to test if an element is None
is too python2.4. Our unit testing framework 'testtools' supports
assertIsNone and assertIsNotNone, included from python 2.7,
which were created for these types of tests.

Change-Id: Iee1379b941f93388900e89388676000b845fc8fc
Comments for db.api.compute_node_*() methods

This patch provides the compute_node_*() methods in the db.api module
with more detailed comments (including :param and :returns comments).

Change-Id: I8d292fb9a163d24f34451e747ed1701083ba7c63
Remove security_group-related methods from VirtAPI

This patch removes the no-longer-needed security_group-related
methods from VirtAPI.

Related to blueprint compute-manager-objects
Related to blueprint virt-objects

Change-Id: I0326f25754e7a13dfc18f207242052412189c743
Merge "Remove security_group-related methods from VirtAPI"
Replace assertEquals with assertEqual - tests/api

The method assertEquals has been deprecated since python 2.7.
http://docs.python.org/2/library/unittest.html#deprecated-aliases

Also in Python 3, a deprecated warning is raised when using assertEquals
therefore we should use assertEqual instead.

This is part of blueprint assertequal

Change-Id: I72f612cc62f90a079c9c53747e3bcbfebfb8eb96
Merge "clean up numeric expressions in tests"
Make metadata server use objects for Instance and Security Groups

This makes the metadata service fetch an Instance object to
do its work, and use the SecurityGroupList object to avoid
calling directly to conductor's API for those two things.

Related to blueprint compute-manager-objects

Change-Id: Ia12f48227eb2380f5da93313cd4045577d8857c9
Deprecate two security_group-related methods from conductor

The security_group_get_by_instance() and
security_group_rule_get_by_security_group methods are no longer needed
so this patch deprecates them here.

Related to blueprint compute-manager-objects

Change-Id: I43d01fc35b7e0989e96d053e980ebbf020264e37
Convert evacuation code to use objects

This removes a couple of calls to conductor to fetch instances
during the evacuation recovery process.

Related to blueprint compute-manager-objects

Change-Id: I41c8ab3ecb85f5ecdca4d515a1d203296e9d5e30
Make _get_instance_nw_info() use Instance object

This makes the _get_instance_nw_info() method use the Instance
object instead of a direct conductor query to do its job.

Related to blueprint compute-manager-objects

Change-Id: I53cc2e7844d5c4a43c6bb4c08c97f1547e5e6984
Make unshelve use new style BDM

Unshelving an instance requires recreating it, and since change
I5b9c3e2d959c602fa22f49db681da918ae0adcea, it is necessary to call
compute manager's _prep_block_device with new style BDMs.

This patch makes the conductor return new-style BDMs when unshelving the
instance.

Closes-bug: 1246412
blueprint: clean-up-legacy-block-device-mapping

Change-Id: I0ba9f53c31c4d5238319cfd09600ad64f298629e
Merge "Refactor unit tests code for python3 compatability"