Rework get_network_from_name() function
This commit reworks the logic in the get_network_from_name() function
to make what it's doing a bit easier to follow. Instead of returning
either the expected response or an incomplete response given a failure
this instead will raise an InvalidException instead. The callers of the
function are then updated to handle that exception appropriately.
As part of this it cleans up some uses of the NotFound exception from
tempest-lib. This exception is RestClientException and is only expected
to be used with a 404 response. It was previously just used as a local
exception to trigger the same failure path as if a 404 was received.
For clarity this changes that exception to raise an InvalidConfiguration
instead, because the raises are caused by an invalid network name being
provided in configuration (either through the fixed_network_name option
or the accounts.yaml file) At the same time as this logging calls are
made more consistent.
Change-Id: I709dce36210efa9038ce2d98328fc1740d9bf493
2 files changed