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
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
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
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
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
libvirt: split and test finish_migration disk resize

Adds a '_disk_resize' method to help resizing disk
by checking and preparing the disk to be extend with disk.api.
Update finish_migration to use this helper.

Closes-Bug: #1298975
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>

Change-Id: Iefe16915a2e657d848629d7e4a4fcf67298f913e
Fix state mutation in cells image filter

Stop set pop() operations in the cells ImagePropertiesFilter from
mutating capability state.  This causes a race that can break the
filter between requests.

Closes-Bug #1325705

Change-Id: I901e39046a38ab60c23ddc8762ef5d19a297935b
Fix InstanceActionEvent traceback parameter not serializable

The change to use InstanceActionEvent in compute.utils.EventReporter
changed the order of how things are done. Before, traceback info were
converted to a string before being sent to the conductor. Now, since
the object method being used remotes itself, the order becomes the
opposite and any captured tracebacks are sent as is, resulting in
errors during messaging.

This adds a serialize_args decorator for this case, which handles
this specific case for the event_finish_with_failure() classmethod.
A more generic approach is needed, and that will be applied to the
also-affected but currently-unused finish_with_failure() instance
method.

Change-Id: Ibedddd606b9d25ffbbb2b1b5358cf0aa4741083f
Co-Authored-By: Dan Smith <dms@danplanet.com>
Closes-Bug: #1317804
Merge "Catch InstanceInfoCacheNotFound during build_instances"
Merge "Fix security group race condition while listing and deleting rules"
xenapi: add tests for find_bad_volumes

Added some unit tests of the exiting method that appeared to have no
unit test coverage.

Change-Id: I3e2a22c76eb08048032b28a1053f02d93107614c
Merge "VCDriver - Ignore host in Maintenance mode in stats update"
Don't log TRACE info in notify_about_instance_usage

Exception information was added to notifications a while back and
logging of tracebacks from those exceptions was added as well.  This can
be confusing because the exception information may be suppressed where
it's caught and then unexpectedly logged later.

Change-Id: I040f7c7e5062672356000a1c50c4da2e857a7cbc