OS API should return SHUTOFF, not STOPPED

The recent changes to vm_state/task_state changed the behavior of OS API
to return STOPPED instead of SHUTOFF.

Fixes bug 1019016

The API spec says that SHUTOFF should be returned:

http://docs.openstack.org/api/openstack-compute/2/content/List_Servers-d1e2078.html

Change-Id: I0a6c786dc8d6b8b42f462cfbec5b70cb67aa2385
Clean up cruft in nova.image.glance

* Directly import glance.client rather than through importutils
* Arbitrary code cleanup (spacing, comments, etc)

Change-Id: I27410e5e37bcb010e68c964fbdb6d2e46608cc87
Add PEP8 checks back for Dom0 plugins.

Fixes bug 1018641

Change-Id: Id61947252fe4d3f5b93279518128ba90100f3748
Dom0 plugin now returns data in proper format.

The virt-layer code was refactored so that a dict was used to pass
around which VDIs are present. This code makes the Dom0 plugin return
that same data structure so we don't have to perform an extra conversion
step.

Change-Id: Ib4f1b0082138d233eb0c3873bbc553395510bc8d
deallocate_fixed_ip attempts to update deleted ip

Fixes bug 1017633. When deleting a vm, the nova
network manager looks to deallocate wrong fixed
ip when context has read_deleted set to 'yes',
in case when a network had been deleted and re-
created , it attempts to update already deleted
fixed_ips and therefore looks to teardown from
wrong network_id as well.

Change-Id: I574a20273220ef81498403da80f489732ae81eb1
Merge "Clean up cruft in nova.image.glance"
Merge "Dom0 plugin now returns data in proper format."
Merge "Add PEP8 checks back for Dom0 plugins."
Flesh out the README file with a little more useful information

The current README file contents are amuzing, but could contain
more useful information for downstream users / developers. This
is an attempt to fill out the README file with further content.

Change-Id: I1c364d107d1d6caf110d223560cee3a0a065ee6b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Merge "OS API should return SHUTOFF, not STOPPED"
Remove passing superfluous read_deleted argument

model_query() will already set read_deleted to context.read_deleted if
a read_deleted argument is not passed

Change-Id: I3778149e5df4c3a7d62a9cf7186c3f65273359ca
Add check for no domains in libvirt driver.

A check is needed to see if there are any domains before calling
the listDomainsID() method. This check is needed to add support
for OpenVZ which will throw an exception from this method if there
are no domains. The 'virsh' source code does this check, too.

This change circumvents this libvirt bug:
   https://bugzilla.redhat.com/show_bug.cgi?id=836647

Change-Id: Ia71d996722a1b531e720e91c1fa68f561ad4d58d
Ability to read deleted system metadata records.

Update _instance_system_metadata_get_query to use read_deleted from
the passed in context instead of just hard-coding "no". Also, use
this to ensure system metadata is always collected during delete,
even if the instance was deleted elsewhere.

Fixes bug 1019357

Change-Id: I9285f110801435344fcaa76ba21fb88c23aac2fa
Merge "Ability to read deleted system metadata records."
Refactoring code to kernel Dom0 plugin.

The kernel and ramdisk VDI manipulation code really has nothing to do
with Glance so it doesn't make a lot of sense for it to exist in the
Glance Dom0 plugin.

This patch refactors the code out to its own plugin and then applies a
few misc cleanups.

Change-Id: I363d54ea3c2d51aa6a6c1635b4fb59ebb9ce1fc0
Create instance in DB before block device mapping

Fixes lp 1019334

A recently added foreign key constraint on the the block_device_mapping
table causes boot-from-volume to fail, as the bdm is populated before the
instance DB entry is created.

This fix simply transposes the ordering to avoid breaking the constraint.

Change-Id: Ic62ea3ba000a2cdf58d2bd5bb17dde2b8cf340e4
Remove duplicate volume_id

Remove duplicate key 'volume_id' in a for loop in _update_block_device_mapping
in nova.compute.api

Change-Id: I43e51cb077334818abea0c1d3bdda4b761406ea4
Run hacking tests as part of the gate.

Nova has additional pep8 "plugins" that they expect to run as part of the
gate. This patch will run tools/hacking.py instead of pep8 directly. Also,
it fixes the hacking violaions in contrib, plugins and smoketests.

Fixes bug 1010136

Change-Id: I86d8789218c197d5d4a43d1201465d340646a395
Merge "Flesh out the README file with a little more useful information"
Merge "Create instance in DB before block device mapping"