Make scheduler disk_filter take swap into account

The disk_filter, which makes sure a node has enough disk space for an
instance doesn't take the swap partition into account, but swap takes up
disk space so it should.

Change-Id: I0779dcf0f1cd60017b5b49ca38c0a15b23d802d7
Closes-Bug: #1239009
Remove fake_vm_ref from test_vmwareapi.py

This fake method is useless now, we can remove it for now.

Change-Id: Idcef18f1e89cac30b1481580731a4f61b0f22050
Make the vmware pause/unpause unit tests actually test something

The pause/unpause tests for vmware were just passing so this patch
actually makes them test the pause/unpause methods for the
VMwareESXDriver and VMwareVCDriver classes.

Closes-Bug: #1237679

Change-Id: Idf7c6e6f9542b9ab4dd2ab710597f1a198889dfa
Fix OLE error for HyperV

When run live-migration on HyperV, an OLE error
will occur. This is because we use wrong WQL
sentence when we try to query table
'Msvm_ResourceAllocationSettingData'.

This commit fixes the wrong WQL sentence.

Closes-Bug: #1246592

Change-Id: Iabb4096002a5be1fb930b077fbf5ef734893c258
virt root tests: replace assertEquals with assertEqual

assertEquals will be deprecated in Python 3.

This is part of blueprint assertequal

Change-Id: I635ba12a553c33cf962dac22bd38bfcb51ca6f61
image tests: replace assertEquals with assertEqual

assertEquals will be deprecated in Python 3.

This is part of blueprint assertequal

Change-Id: Iabce801165527856e410ac11bfb2842c26c9ad2e
baremetal: replace assertEquals with assertEqual

assertEquals will be deprecated in Python 3.

This is part of blueprint assertequal

Change-Id: I5965cd2d0e05551d5ccdfa68f385770b8801dd91
driver tests (loose ends): replace assertEquals with assertEqual

assertEquals will be deprecated in Python 3.

This is part of blueprint assertequal

Change-Id: I311fd876812eead7243c1ad820b88e83fee397ab
xenapi: Move settings to their own config section

This commit changes xenapi_* config options to their own section
with the xenapi_ prefix removed where appropriate.  The change
is done in a backwards compatible fashion such that previous
nova.conf files still work.

As part of this update the sample file and text strings are
also updated to reflect new config options.  Test cases have
been adjusted to handle the config hierarchy.

2642897d6f5b8a211424519d99feddc89c3bf180 was followed to
implement this change.

Change-Id: I2e9f720ddce284fc112d6a5651fd277e6e31a17a
Closes-Bug: 1207253
DocImpact
Merge "Make scheduler disk_filter take swap into account"
Merge "Fix OLE error for HyperV"
Merge "Remove fake_vm_ref from test_vmwareapi.py"
Merge "baremetal: replace assertEquals with assertEqual"
Merge "driver tests (loose ends): replace assertEquals with assertEqual"
Merge "virt root tests: replace assertEquals with assertEqual"
Merge "Make the vmware pause/unpause unit tests actually test something"
Merge "image tests: replace assertEquals with assertEqual"
Merge "xenapi: Move settings to their own config section"
Ensure that libvirt files are not world readable

The files that nova shares with libvirt and QEMU may contain user
sensitive information and it might be a problem if those files are
visible for all the users in the machine. These files include the images
under instances_dir, the base images and snapshots.

This patch introduces a new decorator that will change the user
file-creation mask temporarily during the call of a method, allowing
us to mark methods that shouldn't create world readable files thus
protecting them.

Also in this patch, all the calls that interact with libvirt owned files
have been modified to use rootwrap so they can still access these files
(for resizing an image, snapshoting a disk or migrating an instance).

As a side effect, by setting the proper permissions to libvirt files and
accessing them using rootwrap, this patch avoids problems with cached file
attributes that might trigger problems as the one described in bug 1218372

Closes-Bug: #1129748
Closes-Bug: #1218372
Closes-Bug: #1227027
Change-Id: Ib290f8df20a9e29ed98faec221f607b685e26da4