Ironic: Do not try to unplug VIF if not associated

During instance spawn, Ironic attempts to unplug any plugged VIFs from
ports associated with an instance. If there are no associated VIFs
to unplug, this would raise an exeception that would be logged into
n-cpu. This patch fix that behavior by making the driver check if the
port has an VIF associated with it before trying to remove it.

Change-Id: I5608b9eec625452edda9a0c9eb366ece2a95800f
Closes-Bug: #1292733
Fix the os_networks display to show cidr properly

Converting network_get and network_get_all to use objects broke
the display of the os_networks extension, because IPAddress
fields in Network objects are dumped as lists by the jsonutils
extension. We therefore must explicitly convert these object
field values to string.

The tests are updated to use objects so that we pick up bugs
like this in the future. Incorrect assertEqual parameter order
is fixed in the tests too since these are comparing dicts and
it's not fun debugging a MismatchError when the reference/actual
values are backwards.

Change-Id: I0f05a9b4d7bbe5fe0a3b110c191455ca7edefcb5
Closes-Bug: #1376945
Co-authored-by: Matt Riedemann <mriedem@us.ibm.com>
Break out quota refresh check code from quota_reserve()

This moves the logic that is checking if a quota refresh is needed into
a private method.

This is part of a larger series to refactor the quota_reserve method.

Partial-Bug: #1369605

Change-Id: I07fa1a5d53708f33b68a49186dbc5db15a1dbf17
Merge "Fix the os_networks display to show cidr properly"
Merge "Ironic: Do not try to unplug VIF if not associated"
Merge "Break out quota refresh check code from quota_reserve()"