Don't change the default attach-method

Don't change the default attach-method.  The one configured by the
libguestfs packager is supposed to be correct for all libguestfs
users, and making ad hoc changes to it is not advisable.

For more information, see:
https://bugzilla.redhat.com/show_bug.cgi?id=984409#c8

Fixes bug: 1220102
Change-Id: Ie7726c37dd579e2c95b6156a9ddfdff9e855af83
Fixes inconsistency in flavors list with marker

Flavors list with marker is supposed to use flavorid as the marker since this is
the only id attribute the users can see, but it was using id (the confusion was
probably caused by the fact that flavorid attribute shows up to the user as id).

The change on db unit test shows makes the bug evident, and justify the changes
on the filter_by criteria.

Fixes bug 1226698

Change-Id: I3ffa636febb63be796fffc94be6486bf74e8239b
hyperv: Initialize target_iqn in attach_volume

The target_iqn is referenced before it is declared in the
case that an exception is encountered in _login_storage_target
or _get_mounted_disk_from_lun.  This causes the exception path
to cause an additional, misleading, traceback to be printed
after an exception is encountered.

This commit initializes target_iqn at the beginning of
attach_volume to avoid the traceback.

Change-Id: I1cdfb9dfa054ee4f4f6918d7bc49081ccaebab9d
Close-Bug: 1233837
Fix divergence in attach_interfaces extensions

I pointed out in revision 7 of Ibe4cbd025700aa0d73a6d4d19fbf8f0005509428
that it we shouldn't use a different variable name in the identical code
shared between the v3 and v2 extensions, but that was never fixed before
merging.

Change-Id: I7c2853db2cbad30a37efd98947ebe687b37bfbe8
Move `utils.hash_file` -> `imagecache._hash_file`

`hash_file` is only used by `imagecache` so it doesn't make sense (yet) for it
to be included in utils.

Change-Id: I2f4d1deb03e4afceb911ef4b6d6ae6760ddca225
VMware: remove deprecated configuration variable

Removes support for vnc_password configuration variable.

Closes-bug: #1235118

Change-Id: I70fd7d3ee06040d6ce49d93a4becd9cbfdd71f78
Plug Vif into Midonet using Neutron port binding

Currently Midokura uses its own script (mm-ctl) to bind ports. However, support
for using this script is left out of the nova and neutron projects. This causes
confusion and makes deployments unnecessarily complicated for customers using
Havana. This fix is to change nova to properly use mm-ctl. Corresponding
changes will be submitted to devstack and neutron.

Change-Id: I7c9edded5ab6fe19b63e54cd6905d9242e4a90cc
Closes-Bug: 1235132
VMware: fix bug with booting from volumes

When booting from a volume without an image reference would cause
an exception.

Change-Id: Ib0302197b8d4f5e054a8c4426cb0dde7cb82842e
Closes-bug: #1235022
Fixes typos in the files in the nova folder

blueprint fix-nova-typos

Change-Id: I0971b98999381183c0c77fff1d569180606e338b
Fixes typos in nova/db code

blueprint fix-nova-typos

Change-Id: Ie2e9447790468aee14c6baee679c53d183c69f62
Fixes typo in ListTargets CLI in hyperv driver

Closes-bug: 1237432
Change-Id: Ie7b4cd744e2a4869a84ab42ad1a434628e39a3e6
Fix root disk not be detached after deleting lxc container

Add teardown_container action when cleanup lxc instance to make
sure root disk be detached and no resource leak.

Fixes: bug #1208387
       bug #1203927

Change-Id: I063fd3a9856bba089bcde5cdefd2576e2eb2b0e9
Fix status code of server's action confirm_resize for v3

The status code of confirm_resize should be 202, but it
returns 204 now. That because it returns HTTPNoContent
that overwrites the status code of decorator 'wsgi.response(202)'

And adds API samples for confirm_resize that used to test
the status code of confirm_resize.

Partially implements blueprint v3-api-unittests
Closes-bug: #1233561

Change-Id: I50a3046866af0a1efdb5c41ded40f973b02843e8
catch exception in start and stop server api

this catches exception.InstanceIsLocked in start and stop
server api.

Closes-Bug: #1233026

Change-Id: Ibb882178ab0770837702d503ef88c6510072e33f
baremetal: Use network API to get fixed IPs

Previously baremetal volume driver used DB API to get fixed ips and
DBNotAllowed was raised.

Change-Id: Ie2281311af1b60f55b5b719a2e2df6316bbaa9f6
Partial-Bug: #1208707
Use print function rather than print statement

This is for Python 3 compatibility, since Python 3 does not support
the print statement, only the print function.  (Python 2.6 and 2.7
support both, depending on whether a __future__ import is used.)

Paths containing "xen" were left alone, because of comments in a
couple of the files indicating that the XenServer code needed to be
compatible with Python 2.4.

Fixes bug 1226943

Change-Id: I23b804a4d99500b4acf81dd19645ab06dfcc9f1c
Fix typos in nova/api code

blueprint fix-nova-typos

Change-Id: Idd9c5458c5fc0facd9f3c55f907acb7acc4c1b0f
Fix incorrect root partition size and compatible volume name

When using rbd backend, it needs to resize volume size if size presents. Else
we will get wrong image size.

Rbd volume always uses uuid as the main pattern of volume name, now change to
it is necessary.

Fix bug 1219658

Change-Id: I3dc8d639b066eac35d190b8d4687c41c9f4d5824
VMware tests: replace assertEquals with assertEqual

In Python 2.6, both assertEqual and assertEquals are
convenience aliases to failUnlessEqual.

In Python 3, failUnlessEqual is explicitly deprecated.

This is part of blueprint assertequal

Change-Id: I4121817277c11e82e0ed63ef8bd1c1e4c951a018
Utilizes assertNotIn

Using assertTrue and the 'not in' operator to test
if an element is in a sequence is too python2.4.
Our unit testing framework supports assertNotIn,
which was created for these types of tests.

This patch is a mere sed replace of one-liner assertTrue and assertFalses

grep -lR "assert.* in " nova/tests/* | \
xargs sed -ri 's/(\W+self.assert)True(.+) not in (.+)(\)$)/\1NotIn\2, \3\4/'

grep -lR "assert.* in " nova/tests/* | \
xargs sed -ri 's/(\W+self.assert)False(.+) in (.+)(\)$)/\1NotIn\2, \3\4/'

Change-Id: I99471c81b0cbcd46bb48aca8570f3234f2924f60