Avoid deadlock when logging network_info

_plug_vifs() and _unplug_vifs() in driver.py both log network_info

However network_info is not a simple structure, its a reference to
a wrapper class that wraps a green thread for async network
allocation. Accessing network_info forces a wait on the wrapped
thread (if the network allocation has not completed), which can lead
to a deadlock as follows:

Thread 1 (periodic task in Nova) has grabbed the COMPUTE_RESOURCE_SEMAPHORE
in update_available_resource, and is waiting for the IO thread lock in the
logging handle routine

Thread 2 (in the ironic driver) has grabbed the IO thread lock in the logging
handle routine and is waiting for the async network object to be ready so
_str_ can be called to finish formatting the log message

Thread 3 (which is doing the async network object allocation) wants to call
update_usage in the resource tracker, but that needs the
COMPUTE_RESOURCE_SEMAPHORE which is held by the first thread

The problem is similar to https://review.openstack.org/#/c/71409
and the fix is simply to covert network info to a string before the call
to LOG()

Closes-Bug: 1364059
Co-authored-by: Michey Mehta michey.mehta@hp.com

Change-Id: I3b750ac386588d9235ff10a972b3ab1d8f45cf38
Merge "Avoid deadlock when logging network_info"