add hints to api_samples documentation

Based on my own experience and questions I recently answered in
the openstack-nova channel, these hints could help developers.

Change-Id: Id7350f1a6a834b0de8456fdc28c2db890f2971de
Sync log.py from Oslo-incubator

This change syncs log.py and it's dependencies from Oslo-incubator to
include the password sanitation fix that landed in Oslo with commit
76b0cd10c414ae71e6f041adb431460b3337c63d.

The following is a list of the change IDs that this
commit is bringing in from the last sync of Oslo-incubator with
respect to the files we are touching.

2b40a10 python3: Fix UserString import
c331e74 Enable multiple translation domains for gettextutils
89369c3 gettextutils: port to Python 3
6d49bca Translate all substitution elements of a Message object
3970d46 Fix typos in oslo
88db9c8 When translating if no locale is given use default locale
53ebd30 python3: use six.text_types for unicode()
25c5854 Adds admin_password as key to be sanitized when logging
2251cb5 Do not name variables as builtins
04c1b5a Type check for Message param to avoid AttributeError

Change-Id: Ie4d5929604e3fc057ea09edbbf3adf16f8839a4e
Partial-Bug: #1247217
Use password masking utility provided in Oslo

Implement the mask_password function provided in Oslo-incubator's
log.py. Instead of having a specific version in Nova different from
other projects that are essentially doing the same thing.

Change-Id: I7e04b7d31d4d6959b17b1da9654553042eec70f1
Closes-Bug: #1247217
Add default arguments for Connection class

The fakelibvirt.Connection class, among other things, mocks
libvirt.virConnect which doesn't require any parameters. This is
causing a test to fail.

Change-Id: If77864cb0d0bd1dae20b490b8e87a32a0951b52e
Closes-Bug: 1257876
Merge "Add default arguments for Connection class"
Merge "add hints to api_samples documentation"
Merge "Sync log.py from Oslo-incubator"
Merge "Use password masking utility provided in Oslo"
XenAPI: Speedup host_ref cannot change - get it once

The host we run on is fixed - getting this each time from XAPI
is expensive

Change-Id: Ifee9a778f3ed855ef52b001de3fc2ebbd0b972cf
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
XenAPI: Speedup get_vhd_parent_uuid

In many cases the VDI record has already been retrieved.
Use it rather than expensively getting a new VDI record from XAPI.

Change-Id: I469e2a415c1f1924010f47d3927ca18c45a7b8f8
XenAPI: Use get_VALUE in preference to get_record()['VALUE']

Replaces calls to get_record where only a single item is retrieved
from the record with the specific get_VALUE call.

Change-Id: I52e20c4f4c9d6a6ad019694916ee057cc96b18a6
XenAPI: Synchronize on all VBD plug/unplug per VM

Dynamically adding or removing a device needs to be synchronized
to work around a bug in XenServer 6.1 and 6.2 where simultaneous
events can be partially ignored, leading to a failure to plug or
unplug.

Change I041365ed863a1a1c55e88025dff42d01c35494a2 attempted to
work around the issue by retrying - however that does not catch
all failures.  This change should eliminate some of the known
INTERNAL_ERROR failures, but not all, so I041 should not be
reverted.

Change Ie7a64c481a9e3874df9d5924fbb050ac7ab117db does the same
as this, but only for VBD.plug.

Change-Id: If78d4e5f1dd84f1d4a588f25b8f887a7b125bbea
Closes-bug: 1217972
XenAPI: Monitor the GC when coalescing

Add a new host plugin to monitor whether the garbage collector is running.
This is then used by the wait_for_vhd_coalesce function to know whether
waiting any more is likely to produce the expected results.

Increased the number of times we loop waiting for coalesce as the loop
now has knowledge that something is still happening.

Change-Id: Idcc0738945bd1aee8cdb52c9cfabd798f85c31db
Closes-bug: 1258169

Conflicts:

	nova/virt/xenapi/vm_utils.py