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
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
Don't return from a finally block

The code in the finally block always executes, even if an exception is
raised. If a return is done, that will cause exceptions to be silently
ignored.

Some unit tests have been failing because of API changes to the
nova.compute.manager:ComputeManager._delete_instance method but the
use of finally/return ended up silently ignoring that error and
caused the test to appear as if it was passing. Another unit test
fails because of a missing uuid attribute.

It could also potentially cause other exceptions to be ignored at
runtime (such as SystemExit) which is likely not the intended
behavior.

Change-Id: I083ee7215296e35a0027be5b3ddf8b764f44cc5b
Closes-bug: 1324277
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 "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
xenapi: refactor detach volume

Share more code between detach and detach_all, and make it easier to
read. At the same time, improve the test coverage.

When introducing the new tests, I created a common test base class,
VolumeOpsTestBase that matches VMOpsTestBase.

Change-Id: I7c9d677e7b589b525e2c6ebc43ef81a64a57511d
Do not replace the aggregate metadata when updating az

When the aggregate availability zone is updated, the
existing metadata should not be replaced

Change-Id: Ife856af9e7dca836ebe8a1ec050effaad421e17d
Closes-Bug: #1274924
Catch InstanceInfoCacheNotFound during build_instances

instance.refresh() is raising InstanceInfoCacheNotFound which is logged
by the conductor and would cause all following builds to fail in a
multiple build request situation.  The cause appears to be a race
condition which should be addressed separately, but for now this
exception should be caught, logged, then ignored.

Change-Id: Ibf9e6687933ee90dad54b1998b243ef7256d79ca
Closes-bug: 1324793
Remove useless codes for server_group

Some codes about 'extract_members' from 'create_server_group'
is written in original bp/patch's reviewing
(I650a8f191dea5eab5b4b1828f0b9f65e33edea2a).

But as the design variation, it can't be specified members
in create API (see it in PS29 vs PS30).
But some useless codes are still kept after this feature merged.
So it's necessary to remove them.

Change-Id: I087c8389f2c735a36d656b44c6a3ecfe3a4aa5a3
Closes-Bug: #1325148
VMware: create utility functions

The following method has been moved to utility functions:
 - _get_values_from_object_properties

This is now in the vm_util module and is called:
 - get_values_from_object_properties

In addtion to this _get_diagnostic_from_object_properties
has been dropped and the code using that method now leverages
get_values_from_object_properties.

This is related to the blueprint vmware-spawn-refactor.

Change-Id: I5033cae8838179b4c1ace327a42dc626493f19e8