Make metadata content match the requested version of the metadata API.

Currently the same metadata is returned no matter what metadata
version is requested. Metadata is currently implemented to version
2009-04-04 (apart from existing TODOs) as defined here:
http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html

This change adds version checking conditionals throughout
get_ec2_metadata and only includes the metadata if the requested version
should contain it.

When there is a difference between Amazon API implementation and documentation
I've gone with replicating the implementation. So far differences include:
- undocumented hostname introduced in 1.0, deprecated in favour of
  local-hostname
- kernel-id and ramdisk-id seem have to been implemented in 2007-12-15,
  not 2008-02-01 as documented

get_ec2_metadata has also been reordered so that data is added oldest to
newest by API version. In a future change I may attempt to add
unimplemented API versions (2011-01-01, 2012-06-01).

Change-Id: Ibf6e6e3b9807f29dccd31006515df550bf9bf57b
Janitorial:  Catch rpc up with a change in common

Common rpc now uses jsonutils instead of json; this
patch moves that change into nova.

Change-Id: Iba45e473ae875b0973dbe6f752602b58c7980578
Properly name openstack.common.exception.

Now it's 'nova.openstack.common.exception', thanks to a more modern
update.py in common.

Change-Id: I4b3caf9014f866da3a5bbf07ab194fc9910159b0
Fix snapshots tests failing
bug 1022670

When running snapshot test, FLAGS.instances_path is defined as '',
with snapshot_directory='/snapshots' which will fail to to permissions errors.

Modified class LibvirtConnTestCase to use libvirt_snapshots_directory=''

Change-Id: I930e4f30ddffcf66c58312e92f0ae368e770e438
Expose over-quota exceptions via native API.

Fixes bug LP 1021373.

Previously an over-quota condition would be exposed via the EC2 API,
but hidden in the corresponding call via the native API (in the sense
of the exception detail being replaced with a generic 500 Server Error
response).

We now report any NovaException declared to be safe. In this patch,
the set of safe exception types includes any subclass of QuotaError,
but in subsequent patches the net should be widened to include
exceptions that do not expose senstive information.

Change-Id: I3cc36337c7e67cf487ca49de646c437c217ae538
Always attempt to delete entire floating IP range.

Fix bug 1021222.

This patch tweaks nova-manage to always attempt to delete all addresses
in the specified IP range, even if an error is encountered.  This is an
easy way to handle a case where a range was created, but then a subset
of that range was deleted.  Otherwise, deleting the rest of the range is
a pain.

An example of this would be:

  # nova-manage floating create --ip_range=1.1.1.0/24
  # nova-manage floating delete 1.1.1.1
  # nova-manage floating delete 1.1.1.0/24

Previously this would fail.  Now it works.

Change-Id: Ia01c04dee5383f597976c6a79d9a0d9e19985898
overriden VlanManager.create_networks must return a result

Fix bug #1022469

Change-Id: Iaaa016ea61dd8d26dcd66603abb6f66d22a15bb5
add network creation call to network.api.API

Fix bug #1022470

Change-Id: Iccbbf086fb499e574c86a0f6ffceedfa07e1acf0
network manager returns empty list, not raise an exception

Fix bug #1023805

Change-Id: I9ddb10db127375ad37a7760b53e44782b392c2e3
Raise HTTP 500 if service catalog is not json.

Updates the Nova API auth middleware so that it returns a HTTP
500 error if invalid JSON is found.

Adds a unit test.

Change-Id: I236ced13bac2164e103060e78845a410ceb6cdd4
Use _lookup_by_name instead of _conn.lookupByName

use the helper function instead of the libvirt call directly
to allow NovaExceptions instead of libvirt exceptions to be thrown.

Change-Id: Ieac171e1a2bce1f5542ae73f3d8f6b7a5ccfa8f7
Sync gettextutils fixes from openstack-common.

commit c80bfb563626200f7587c7ca52433c59a303b469
Author: Eric Windisch <eric@cloudscaling.com>
Date:   Thu Jun 28 00:32:52 2012 -0400

    Fix missing gettextutils in several modules.

    Fixes bug 1021453.

Change-Id: I98758a088911cc422b61abd02b3be6cc6d6a472b
Fix spelling in docstrings

Change-Id: I45b913e701c3902e16a73a99fff01c115f63c2a9
Fix SADeprecationWarning: useexisting is deprecated

Fix bug 941951

Change-Id: I941df9260a4fbb27f5776f582ad8f59a1e32ea8b
Extension to show usage of limited resources in /limits response.

This extension add information such as the total amount of ram being used by a
user to the /limits response in order to be used by the client/user.

Change-Id: Ia23c1858bda31cf28209d5a593774e53e79d8ccf
Attach ISO as separate disk if given proper instruction.

This gives the option to attach the ISO as a separate drive, like we do in
XenServer, and boot from that instead of replacing the root drive.

Fixes bug 914484.

Change-Id: I0e0560f5fcbc361b60ff1284e7369997dd770fd9
General-host-aggregates part 1.

Partially implements blueprint general-host-aggregates: Xen decoupling

* keep rpcapi to compute-controller for Hypervisor-Pools
  *  Add compute_rpcapi.add_aggregate_host to libvirt
* Remove aggregate states
* Remove One aggregate per host restriction
* Keep Xen support for both hypervisor pools and aggregates

Change-Id: I6ac0f8b6fc31dff589363331e99e0755301f2172
Merge "Extension to show usage of limited resources in /limits response."
Merge "Fix SADeprecationWarning: useexisting is deprecated"
bug 1024557

De-dupes the list of DNS IPs that is put in the xenstore for network configuration

Added a duplicate DNS IP in the fake_network to create a valid test.

Change-Id: I25a00c7e47578b1667992aa4bad879667198465a