Fixes the usage of PowerVMFileTransferFailed class

If it fails in the process of "Calculate file size in multiples of 512
bytes", the exception.PowerVMFileTransferFailed message is illegal.
"KeyError: u'file_path'" is occurs when there is no argument.

Change-Id: I15a7467bbc103f683d82949dc0892210cd63c4b6
Closes-Bug: #1223198
Code change for regex filter matching

Remove REGEXP_LIKE operator for oracle db backend since it's not suitable,
Such as:
Oracle: 'select xxx from xxx where REGEXP_LIKE (column, pattern)'
Mysql: 'select xxx from xxx where column REGEXP pattern'

For the simple pattern matching(LIKE operator) used for unsupported backend db,
add '%' wildcard character on both sides of the value.

Change-Id: I4682d38086a06032bb5650a14b253f6b2b859613
Closes-Bug: #1230102
Fix type is overwritten when UPDATE cell without type specified

If you not specified the 'cell-type' in UPDATE request,
  the value will be overwritten by the default value, 'child'.
That's not correct, you need to reserve the existing cell-type.

The issue is also involved in the new V3-api.

Fixes bug: 1224461

Change-Id: I5c5043b9e5e0c33995422094284c3f19aac78593
plug_vif raise NotImplementedError instead of pass

The Hyper-V, VMware, Docker and PowerVM drivers raise
NotImplementedError from the plug_vifs and unplug_vifs
methods rather than pass.
The compute manager handles the NotImplementedError
case when initializing the host.

Fixed bug 1218593

Change-Id: Id17a1f691f46816eadfe257d9ac0cc46502318ef
Ensure image property not set to None in build_request_spec()

This is in preparation for having scheduler.util.build_request_spec()
construct the request_spec in the live migration code. Specifically, this
change is needed to avoid reintroducing bug #1199811.

Change-Id: I0cc6b6ec7be7a0afbe184b208f2e16fd5cd4452c
Related-Bug: #1224014
Make LiveMigrateTask use build_request_spec()

Some filters like TrustedFilter makes use of extra_specs. Currently,
when live-migration uses the scheduler to select a host, it constructs
a request_spec that has no extra_specs in it.

By making use of the existing helper method build_request_spec(), the
request to the scheduler will include extra_specs.

Change-Id: I5bc6c6418653c256a42da7b0a343086ec9863da1
Closes-Bug: #1224014
Resource limits check sometimes enforced for forced scheduling

Resource limit checks on a compute manager are based on the
contents of filter_properites['limits'].   This in turn is
populated by the scheduler after the host has been selected by
scheduler.utils.populate_filter_properties.   The limits value
is taken from the host_state, which is maintained as a local data
in the host manager. The host_state limits values are populated
by the various filters, for example the ram filter sets
limits['memory_mb'] based on its configuration.

In the case of scheduling to a forced host the filters are
bypassed, so the contents of the host_state['limits'] value
depends on whether the scheduler has already placed a non-forced
instance onto that host (and thus run the filters to populate the
limits).   If it has then the compute manager will impose the
limits, if it hasn't then the limits will be empty and there will
be no check.

As forcing bypasses the filters and is a privileged operation the
limits should always be cleared in the filter_properties in this
case to avoid the limit check on the compute manager.

Fixed bug: 1231963

Change-Id: Ic7ff5d1fc652a8bdf6a0cf8e6ef063d9f2e7ab16
Catch volume errors during local delete

The delete code in compute/manager.py has a catch-all exception
handler for any volume related errors that occur during deletion.
This change brings the local_delete() method in compute/api.py
in line with that.

Fixes bug: 1224546

Change-Id: I399075f29d202355b28e7da1b2f1a29a66c86a4e
VMware: Handle cases when there are no hosts in cluster

When there are no hosts defined in a cluster the host value will be an empty
string. For example:

    obj_context: (RetrieveResult){
       objects[] =
          (ObjectContent){
             obj =
                (obj){
                   value = "domain-c185"
                   _type = "ClusterComputeResource"
                }
             propSet[] =
                (DynamicProperty){
                   name = "host"
                   val = ""
                },
          },
     }

This causes an data access exception.

The code will now raise an NoValidHost exception.

Fixes bug: 1197041

Change-Id: I75b1f069e0b27eebd63c280e36533354c04e246a
Host aggregate configuration throws exception

If the virtualization driver did not implement the host
aggregate support functions (add_to_aggregate,
remove_from_aggregate and undo_aggregate_operation) then an
exception is thrown when a host aggregate was created/deleted.
Configuration of the host aggregates breaks tempest tests when
the underlying driver does not have these methods implemented.

The only driver that actually uses this is the Xen driver.
The solution enables all drivers to support this without
having to add in specific code. More specifically, the compute
manager will not raise NotImplementedError.

Closes-Bug: 1229912
Closes-Bug: 1229911

Change-Id: Iee69e45d94047742b6a499a139bac96ad9dd971f
Make rbd.libvirt_info parent class compatible

Rbd.libvirt_info function definition misses hypervisor_version argument added in change:
https://review.openstack.org/32379

Closes-Bug: #1233188
Change-Id: Ib68d743e783af0f6d82d2ba180869ee642e86050
VMware: Check for the propSet attribute's existence before using

There may be cases when the call to RetrievePropertiesEx may have missing
data. That is, the propSet field may be missing. In this case the missing
field will be logged. This will help with troubleshooting the problem.

Fields may be missing due to one of the following reasons:
 - SystemError if there was some unknown problem reading the value
 - NoPermission if the logged in session did not have permission to read
   the value

The propSet attribute is marked as optional in the API documentation so this
should have been anticipated and this can be interpreted as a bug in the
client code.

http://pubs.vmware.com/vsphere-51/index.jsp#com.vmware.wssdk.apiref.doc/vmodl.query.PropertyCollector.ObjectContent.html

Fixes bug: 1215958

Change-Id: If8fd912327e057320cd6013c276000617b9c320c
Fix the wrong params of attach/detach interface for compute driver

The reason of attach_interface failed is current code passing VIF object
to attach_interface, but it expected NetworkInfo object. And as the
comment of attach/detach_interface, they should only accept one
interface to instance. So correct the interface signature only accept
an VIF object. And correct the fake driver behavior, make the test running
correctly.

Change-Id: Id0d28c39fb543853bd710fcb3c3b611306b4fb8f
Close-bug: #1233504
Fix filter_properties of unshelve API

When unshelving a shelved server, nova-scheduler fails because nova-conductor
of current unshelve feature passes an empty list as filter_properties, and
nova-scheduler handles it as a dict.

To fix the problem, this patch changes the filter_properties to an empty dict.

Closes-Bug: #1233563

Change-Id: I2c7a2a743a8142af0be0a182067f3295980aa997
Fixes several misc typos in scheduler code

Change-Id: Id7d86e3be34b650a63679ba086abcb13dfac2eb8
Closes-bug: #1234902
Merge "VMware: Handle cases when there are no hosts in cluster"
Merge "Fix type is overwritten when UPDATE cell without type specified"
Merge "Ensure image property not set to None in build_request_spec()"
Merge "Make LiveMigrateTask use build_request_spec()"
Merge "Resource limits check sometimes enforced for forced scheduling"