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
Propagate setup.py change from common.

This pulls in the following patch:

commit 8a967b16dc2ffd60bc19bee09f45e665ddcc9a81
Author: Monty Taylor <mordred@inaugust.com>
Date:   Mon Jul 2 17:19:06 2012 -0400

    Fix up openstack-common build.

    Ironically enough, even though the code to manage this is in
    openstack-common, openstack-common wasn't using it. This patch fixes doc
    generation, as well as setuptools-git integration and versioning.

Change-Id: Ibb2041b131c67aba963e2dd81dcdfd105e1f9b33
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
When deleting an instance, avoid freakout if iscsi device is gone

It's fairly easy to get into a state where an instance is not running,
the iscsi infrastructure has been torn down, and the instance cannot
be deleted because the iscsi device cannot be successfully removed.
This patch ignores the associated return value for that scenario and
marches forward in the teardown process.

Fixes bug 1022520

Change-Id: Ib28790892eebe341ac10a92250cf872605fefe9b
associate_floating_ip an ip already in use

Fixes bug 10014860 to be compliant w/ AWS EC2 spec
instead of return exception.FloatingIpAssociated,
disassociate from old fixed_ip and associate to
new fixed_ip.

Change-Id: I54ab3492092940dbb01f2787cc329a0162698568
only mount guest image once when injecting files

Previously we could incur the costly guest mount operation twice,
if injecting files with any of net, ssh keys, password, metadata.
Instead now inject files in the same operation.

Also cleanup the internal injection functions a little
by removing the unused 'execute' parameter.

Partly mitigates the impact of bug 1013689.
Change-Id: Ib66d327e745593cf1e5897470750d609b2a58980
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
Making docs pretty!

  * Before: http://stsh.me/2Qv
  * After: http://stsh.me/2Qw

Change-Id: I4609e66820cd49b7443d18b9e0decf638da42581
ensure libguestfs mounts are cleaned up

Make a few attempts to umount the libguestfs
mounts, in case other processes are accessing
the mounts (like udev etc.)

If we still can't umount after 5 attempts
(with average delay of about 1s between each),
then initiate a lazy umount so that the mounts
might be automatically cleaned up at some stage.
We wait a further 10s after initiating the lazy
umount, before raising an exception.

Addresses the original issue in bug 1013689

Change-Id: Ib5ede9f705c833825a19308c140f99c5bf3a776f
Adds bootlocking to the xenserver suspend and resume

Bootlock prevents an instance from being resumed accidentally if the dom0
were rebooted or a whole slew of other possible interactions. We'd prefer to
keep suspended instances suspended.

Change-Id: I82fb734b79270aa87cd3bb08797885d5fda11f6b
Remove deprecated auth from GlanceImageService

* Drop the code block specific to deprecated auth in image
  deletion code
* Remove reference to deprecated auth in the auth_strategy
  config option help text
* Related to bp remove-deprecated-auth

Change-Id: Id0f4f287d33d01d54642fbc544ada9b7ef1b83ec
Fix .mailmap to generate unique AUTHORS list.

As per 3456b667c38aa1d439482b9c95838aba6d3d6c5c, Monty
merged code to generate AUTHORS file.

With this fix, git log honors .mailmap specification,
irrespective of name/email combination used for commit and
generate unique entries in AUTHORS file.

* .mailmap
  Handle all full name/email combination to ensure following
  command return unique records.
   $ git log --format="%aN <%aE>"

Change-Id: I44f1db1a991fd312ab37455b44985281ed1d392f
When over quota for floating ips, return HTTPRequestEntityTooLarge.

Previously we were returning a generic Internal Server Error which seems dumb.

Fixes bug 1021721.

Change-Id: Ia30b8de22bcc00d159bb4894ab4dc5f4870c346b
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
Convert remaining network API casts to calls

Fix for Bug 1021340

During compute/terminate_instance networking is de-allocated by a call to
network/api/deallocate_for_instance(), which is implemented as an rpc.cast to
the network manager. This in turn will eventually call
network/manager/deallocate_fixed_ip(), which in turn call the compute API to
trigger a security group refresh, which will get the instance from the database

However because original call to the network manager is a cast there is a chance
that the compute manager will delete the instance record in the DB before the
compute API (in the network manager) tries to retrieve the instance. At this
point the security group refresh fails (leaving rules in place which are a
security risk when the IP is reused), and potentially stopping otheraspects
of the network deallocation from completing.

Changing this from rpc.call to rpc.cast will fix this issue.

Aside from this specific use of a cast there are 4 other casts in the
network API:
  add_fixed_ip_to_instance
  remove_fixed_ip_from_instance
  add_network_to_project
  release_floating_ip

and to avoid other timing issues these will also be converted to calls.

Change-Id: I5cdcc628293d3e7cf165c5ffe4883f138783f73f
Merge "Fix .mailmap to generate unique AUTHORS list."