Removed copyright from empty files

According to policy change in HACKING:
http://docs.openstack.org/developer/hacking/#openstack-licensing
empty files should no longer contain copyright notices.
Please note, Oslo (nova/openstack/common) not changed!

Closes-bug: #1262424
Change-Id: I26b7d1eabb189f06219b70495d229389b9d3f260
Remove traces of now unused host capabilities from scheduler

Host capabilities updates are no longer used by the scheduler. All host
state is instead fetched from the DB. Some left over fields are still kept
by the host manager but contain no data. This change remove the last
traces of host capabilities from the scheduler.

The baremetal host manager used to rely on capabilities info to
decide which host state class to use, VM or baremetal. This has been
broken since host capabilities were removed (bug 1260265). The logic to
decide on host state class to use is updated to use DB data instead and
a test is added to verify the same.

Change-Id: I350109492c2addf5fdfaadee7cec4784f244e102
Closes-Bug: #1260265
Fix security group race condition while listing and deleting rules

Previously, there was a race condition that could occur if one was listing
a security group which contained a rule which referenced another security
group as an additional api call is used to look up the security group's
name which is returned (rather than id) via the API. The problem occurs if
this security group is deleted in which case a 404 was raised.
This patch fixes this issue by catching the 404 and ignoring the rule as
its already deleted as there is a constraint enforced that you cannot
delete a security group if another security group has a rule that references
that security group.

Change-Id: I3855b8d3a1bd2f7c88901da071f9bd5581bd56e4
Closes-bug: 1262566
Add better coverage support under tox

For those in the community who don't use run_tests.sh but want
tox to have coverage support this small change should help.  It
adds coverage erase, combine, html reporting.  It also
fixes the coverage unit tests in two ways.  The first is
adding the locking like normal unit tests. The second
is adding substring regular expression matching to pick
a subset of tests.  This brings it up to closer par with
run_tests.sh.

Change-Id: If9ea229425dc9a191fa7c5cc073cf5da412a69b7
Add helpers to create per-aggregate filters

This patchset introduce a new file of utility methods
to deal with aggregate metadata.
As well it updates related filters to use this new logic.
* AggregateRamFilter
* AggregateCoreFilter,
* AggregateTypeAffinityFilter

Closes-Bug: #1301340
Change-Id: I5e4aebe9e61cfbdc7b9e6b5de0788fc6670eb936
Correct exception handling when create aggregate

when create an aggregate, InvalidAggregateAction might be raised,
this patch translates the InvalidAggregateAction to HTTPBadRequest.
Also, 2 unnecessary logs was removed becuase log is not output in
most BadRequest.

Change-Id: I3dac808d8edab6118e347eb5d78b96f96b9d40ca
Handle NetworkInUse exception in api layer

In nova-network, if we delete an existing network with port already
associated, a 500 error will be reported and this is not helpful for
end user. This patch catch the network in use exception and raise
an HTTPConflict exception with formatted message.

Change-Id: I7361e461e0eecc0ef6e47fa8ef9a48a24b7d5dfd
Closes-Bug: #1294920
VCDriver - Ignore host in Maintenance mode in stats update

The VCDriver during stats update checks only for connected hosts.
However hosts which are in connected state to the Cluster can
be set to Maintenance mode.
The cluster does not boot instances to hosts which are in
maintenance mode.
Hence the VCDriver should check for hosts which are in
maintenance mode and ignore them for stats update.
VISDK API returns True for the property inMaintenanceMode for
Hosts which are in maintenance mode

Change-Id: Ieaf7530ed2d98c59c5450e8cb75e209823193d49
Closes-Bug: #1316674
Fix migration and instance resize update order

This commit switches the order in which migrations and instances are
updated when resizing an instance. Previously, if you set
resize_confirm_window to some small value, your resize instance could go
into error state because the periodic task was run after the migration
was updated but before the instance object was updated. This change makes it
so the instance is always updated before the migration.

The _test_finish_resize test case has also been refactored to enforce
saving the instance object before the migration object. In the event
that the instance object is saved after the migration, like the previous
implementation, the test cases will fail since the states of the
migrations will be out of sync in the _mig_save assertions.

Closes-Bug: #1321298
Change-Id: I0490fc4b4e03b36eb01a06a95ea761f4cf8df469
Deprecate run_instance and remove unnecessary code

This begins a deprecation path for the compute manager run_instance
code.

For now the scheduler run_instance rpc method is being removed as it is
unused.

In the K cycle the scheduler schedule_run_instance methods can be
removed which means that the run_instance compute rpc method can be
removed.

In the L cycle the run_instance compute method can be removed.

This also removes cells schedule_run_instance methods which have been
unused since Havana.

bp remove-cast-to-schedule-run-instance

Change-Id: I284ac124fe2ec952db0feab61206eda2a20e40c8
Use objects through the run_instance() path

This removes the use of dict-based instances for the run_instance
path when called from conductor to compute manager.

Related to blueprint compute-manager-objects-juno

Change-Id: I8a206f63cab1e4f939d2c97c258312a8fa540aff
Virt: ensure that instance_exists uses objects

Ensure that the method now receives a data object as input.

Change-Id: I6b5a9c9defb61388035ef7d511ccd96998b695aa
Rewrite nova policy to use the new changes of common policy

The oslo has rewritten the common policy for a long time, using a
Enforer class to replace the old check function. In order to sync the
common policy to nova, We have to also changed the nova policy and
related unittests.
Sync policy and relate module from Oslo.
   Some related change-id:Ife909bdf3277ef33c2fb1eae16ae261fa6374c63
                change-id:Ife84189be4b86a3ee90da4539ff2dbed125be23d

Closes-Bug: #1288178

Change-Id: Ic106851a24cfdc9d847f7d0e0d8a6ecbff888e05
Support detection of fixed ip already in use

Update the validate_networks method to detect when a fixed ip is
already in use and raise the FixedIpAlreadyInUse exception

Change-Id: I07f83ce654c909b1158315dfc21a40654bc34a47
Closes-Bug: #1247844
String-convert IPAddr objects for FixedIP.attach()

This fixes a couple places where we pass a (non-serializeable)
IPAddr object to the FixedIP.attach() method, which blows up.
We probably need a more generic solution to this problem, as it
keeps coming up. However, for the moment, this is less problematic
than the patch reverted just before this.

Change-Id: I716c558a3535b3ed5c9b10f5788a4463a3daa3d3
Revert "Convert address to str in fixed_ip_obj.associate"

This reverts commit 5268c1136ed09346d13b28b42626c0b302e3abb2.

A change was made that breaks RPC compatibility since the actual
remotable method was changed to the underscored version.

Change-Id: I2589e914b5141fdea0738d04b4a8e14e349580a0
Revert "Remove quota_class db API calls"

This reverts commit 9c285c4bc777141edc80c6a40a3e1ff491aae217.

The quota_classes API was used to set default quota values
so it shouldn't have been removed, so reverting a series
of changes that removed the API and it's internal code.

Related mailing list thread on the topic:

http://lists.openstack.org/pipermail/openstack-dev/2014-May/035383.html

Partial-Bug: #1299517

Change-Id: I69e374cd0363bb7481c5bc96f1ba6415ac50fa81
Revert "Remove quota_class params from rest of nova.quota"

This reverts commit d1442a6aec5e1e20cb35627b77739dbe92770e7a.

The quota_classes API was used to set default quota values
so it shouldn't have been removed, so reverting a series
of changes that removed the API and it's internal code.

Related mailing list thread on the topic:

http://lists.openstack.org/pipermail/openstack-dev/2014-May/035383.html

Partial-Bug: #1299517

Change-Id: I839bb6570f5c189e04e284eda8cde7bc2ac29fdb
Revert "Partially remove quota-class logic from nova.quotas"

This reverts commit 96c92249a6e48fa391361efd9cdee6eac50b653c.

The quota_classes API was used to set default quota values
so it shouldn't have been removed, so reverting a series
of changes that removed the API and it's internal code.

Related mailing list thread on the topic:

http://lists.openstack.org/pipermail/openstack-dev/2014-May/035383.html

Partial-Bug: #1299517

Change-Id: Iea445877c02205ad64ccbc3864712fd11ba65464
Fix docstring typo in need_legacy_block_device_info

Change-Id: I9aaec5f73f3001c0926aba2fba4165f3a66319f1