Type conflict in trusted_filter.py using attestation_port default value

When trusted filter (nova/nova/scheduler/filters/trusted_filter.py)
in nova scheduler is running with default value of attestation_port:

default='8443'

method _do_request() in AttestationService class has this line:

action_url = "https://%s:%d%s/%s" % (self.host,
self.port, self.api_url, action_url)

It is easy to see that default type of attestation_port is string.
But in action_url self.port is required as integer (%d).
It leads to conflict.

This change provides more tests than is required only to cover this bug
fix. This cases are testing AttestationService _do_request() method
using different status_codes and different texts returned by mocked
request method.

Change-Id: I1ad57b5bd1986360416948fd00dec22456dc29a7
Closes-Bug: #1381468
VMware: enable backward compatibility with existing clusters

When VC 5.5 creates a VM the hardware version of the VM would be set as 10.
This breaks compatibility of VM's running on an older cluster. The patch
enables the VM hardware version to be set. By default the value will not be
set. That is, it will use the current supported version. If the admin wishes
a cluster to be comptable with a specific version then they should set the
value, for example with vmx-08 to be compatible with VM's created by 5.0
and 5.1.

In the event that the cluster has mixed host version types then the VC will know
which host to place them on if the hardware version is set.

The following link describes the versions - http://goo.gl/7lhmEm

DocImpact:
The hardware version will be passed as part of the flavor extra_specs. This will
be with a key 'vmware:hw_version'

Change-Id: I67f65feceab1eab6ec4e8f4934f1c8115ed1e812
Closes-bug: #1367151
VMWare: get storage policy from flavor

This is part of the blueprint vmware-spbm-support. The storage
policy will be passed as part of the flavor extra_specs. This will
be with a key 'vmware:storage_policy'. If there is no storage policy
on the flavor then the default will be used.

Co-authored-by: Radoslav Gerganov <rgerganov@vmware.com>

Change-Id: I75151f092e9424eaf346799072c8cf18a2784c16
VMware: use storage policy in datastore selection

This is part of the blueprint vmware-spbm-support. This patch adds
storage policy as an additional filter to the datastore selection.
Datastores not matching the storage policy are filtered.

Co-authored-by: Radoslav Gerganov <rgerganov@vmware.com>
Co-authored-by: Gary Kotton <gkotton@vmware.com>

Change-Id: Id934b39614bb5d26e109f6f0f58b033173bfbe70
VMware: associate instance with storage policy

This is part of the blueprint vmware-spbm-support. This patch
associates an instance with a given storage policy, if defined.
This enables a vsphere admin to check if the instance is compliant
with the storage policy.

Co-authored-by: Radoslav Gerganov <rgerganov@vmware.com>
Co-authored-by: Gary Kotton <gkotton@vmware.com>

Change-Id: I79f8b165e2a82a7335f50f2a421b10e69c02c9f0
Changed testcase 'test_send_on_vm_change' to test vm change

This patch changed the test case
NotificationsTestCase.test_send_on_vm_change to test the
vm change instead of the task change

Change-Id: I244c5eca5b5b2a254b14126d92e020f072714ade
Closes-bug: #1397247
Fix function name mismatch in test case

The function name is mismatch with the function itself.
'test_user_only' function has the difinition of 'test_user_id_only', and
'test_user_id_only' function has the definition of 'test_user_only'.
This change fixes the function name mismatch with functionality.

Closes-bug: #1397882
Change-Id: Ib7368295a3d5705ab7a49cdb5dab586bef0f1450
Merge "VMware: enable backward compatibility with existing clusters"
Merge "VMWare: get storage policy from flavor"
Merge "VMware: use storage policy in datastore selection"
Merge "VMware: associate instance with storage policy"
Merge "Type conflict in trusted_filter.py using attestation_port default value"
Merge "Changed testcase 'test_send_on_vm_change' to test vm change"
Merge "Fix function name mismatch in test case"