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
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
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
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
Merge "Refactor unit tests code for python3 compatability"
Merge "Remove instance_type* proxy methods from nova.db.api"
Merge "Fix all scripts to honor the enabled_ssl_apis flag"
Merge "Pull system_metadata for notifications on instance.save()"
Merge "Make metadata server use objects for Instance and Security Groups"
Merge "Deprecate two security_group-related methods from conductor"
Merge "Convert evacuation code to use objects"
Merge "Make _get_instance_nw_info() use Instance object"