diff options
-rw-r--r-- | openstack_dashboard/dashboards/admin/hypervisors/compute/forms.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/openstack_dashboard/dashboards/admin/hypervisors/compute/forms.py b/openstack_dashboard/dashboards/admin/hypervisors/compute/forms.py index 2e9a6434b..8082e8268 100644 --- a/openstack_dashboard/dashboards/admin/hypervisors/compute/forms.py +++ b/openstack_dashboard/dashboards/admin/hypervisors/compute/forms.py @@ -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) |