Fix a lazy-load exception in security_group_update()

When security_group_api is nova, the update_security_group api raises http
500 error: group rules fails with lazy load exception. Because the rule
infos of the security group will be return in response body, but the rule
attribute hasn't been preloaded.

Closes-Bug: #1244018
Change-Id: Ie07879ac22e4add90f75968778bf334915e8349c
Refactor PXE DHCP Option support.

The previous support imported pxe into driver, but driver is meant to
be entirely decoupled from specific baremetal drivers.

Co-Authored-By: Robert Collins <rbtcollins@hp.com>

Change-Id: Icc7c40fe06b520aa220906122f5f6be8d79a3ac4
VMWare: bug fix for Vim exception handling

The exception handling in the Vim module was too broad and did not treat
the suds.MethodNotFound exception. This would result in a exception
that "__deepcopy__" is not supported in the VIM module.

In the case of an exception the VMwareAPISession class may be deleted.
The patch also ensures that the deletion is able to logout if necessary.

Closes-bug: #1228847

Change-Id: Ic85be9b3407c444db4b3a074108c01d9141c61be
Enable remote debugging for nova

This patch added 2 command line parameters which are used to
connect to an external debugger such as pycharm or eclipse.
This feature is used when you want to connect to a nova
service via a debugger running on a different host.
To use it you start the nova service with  the following
command line parameters

--remote_debug-host <where the debugger is running>
--remote_debug-port <port> it's listening on>.

DocImpact
Closes-bug: #1251021
Change-Id: I6ede9bf0813eafbeb91d858c297d4c160aafceba
barematal: Cleanup the calls to assertEqual

Switch the ordering of assertEqual calls to match the correct
(expected, observed) ordering. This makes test failures easier to read.

Change-Id: Iecad55e33be4ab8f7ddff3b4cdbe08aa6c1b8660
Partial-Bug: #1260134
Remove docker's unsupported capabilities

The 'supports_recreate' flag needs the driver to support the evacuate
operation. The 'has_imagecache' flag needs the driver to implement the
'manage_image_cache' method. Docker does not currently support these
two functions, so the capabilities flags should not be set.

Partial-Bug: #1261636

Change-Id: I191d0d8cd35aece52462c0477f2d89897bb762c1
Clarify rebuild_instance's recreate parameter.

As far as I can tell this parameter actually implies that none of the
cleanup happens - it's used when evacuating an instance to a separate
hypervisor, so the new hypervisor has rebuild(recreate=True) passed
in. The docstring didn't make that clear, so this trivial patch
hopefully does that.

blueprint: baremetal-preserve-ephemeral
Change-Id: I42463cf981fe5dbd6b3b15f7a247d5a8ccfa7279
Merge "VMWare: bug fix for Vim exception handling"
Make rebuild use Instance objects

This makes the rebuild operation use Instance objects through to
the compute manager. It was already taking them from the rebuild
API code, but converting it to a dict almost immediately, before
it got passed to anything else. This cleans that up and makes it
native.

Related to blueprint compute-manager-objects

Change-Id: I46430af3a52f4fe2f8c2e3c2d654cd8eb0fa1662
Merge "Clarify rebuild_instance's recreate parameter."
Merge "Refactor PXE DHCP Option support."
Merge "Fix a lazy-load exception in security_group_update()"
Merge "Enable remote debugging for nova"
Merge "Make rebuild use Instance objects"
Serialize instance object while building request_spec

The scheduler utility method for building a request_spec could be passed
an instance dict or instance object.  The jsonutils.to_primitive call on
the request_spec dict serializes an instance object but should not be
relied upon because it uses an interface on the object that may go away.
Instead, an object should be serialized properly before going into the
request_spec.

Change-Id: I9d810a0b8ee6f1beb79d831053f4bbd12b761b0b
Merge "Serialize instance object while building request_spec"
Merge "Remove docker's unsupported capabilities"
Merge "barematal: Cleanup the calls to assertEqual"
XenAPI: get_info was very expensive

Getting the whole VM record is expensive and slowed down Tempest tests
significantly.  Replaced with getting each required item.

When getting power state, only need that specific value, so reduce the
calls to get_info too.

Change-Id: I93bcef5b692a531aac41518dc29d5d4f46cded65
XenAPI: Tidy calls to get_all_ref_and_rec

get_all_records is more efficient than getting them individually in the
old get_all_ref_and_rec implementation.

Replaced some cases of get_all_records with a faster and more
specific API call.

Change-Id: I4725c3f1fdebdf1737941cb7db69b19afb22df9f