Merge "Allow to evacuate without specifying a target host"

This commit is contained in:
Zuul 2020-01-18 06:21:33 +00:00 committed by Gerrit Code Review
commit c340145ded

@ -57,6 +57,11 @@ class EvacuateHostForm(forms.SelfHandlingForm):
current_host = data['current_host']
target_host = data['target_host']
on_shared_storage = data['on_shared_storage']
# The target_host value will be an empty string when the target
# host wasn't specified. But the evacuate api doesn't allow
# an empty string. So set None as the target_host value.
if not target_host:
target_host = None
api.nova.evacuate_host(request, current_host,
target_host, on_shared_storage)