[Queens] evacuate fails if target is not selected

Bug #1793694 reported by Alvaro Uria
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Rikimaru Honjo

Bug Description

It looks like the issue fixed in bug 1652494 has been reintroduced here:
https://github.com/openstack/horizon/blob/stable/queens/openstack_dashboard/dashboards/admin/hypervisors/compute/forms.py#L49:L53

When "target host" is set to "Select a target host", Nova API logs show:
"""
body: {"evacuate": {"host": "", "onSharedStorage": true}}
Returning 400 to user: Invalid input for field/attribute host. Value: . u'' is too short
"""

When a target host is selected, Nova API logs show:
"""
body: {"evacuate": {"host": "target-hostnameXX", "onSharedStorage": false}}
"""

In the first case, the expectation is to have both host and onSharedStorage set to False. The latter was never enabled, but it looked so in the first test when it shouldn't.

Horizon is running on Ubuntu Xenial,
openstack-dashboard 3:13.0.1-0ubuntu1~cloud0

Ivan Kolodyazhny (e0ne)
tags: added: low-hanging-fruit nova
Changed in horizon:
status: New → Confirmed
importance: Undecided → Medium
Changed in horizon:
assignee: nobody → Rikimaru Honjo (honjo-rikimaru-c6)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.opendev.org/702642

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/702642
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=f9e0f8a976b82088ef095a69cd1fa892cddde3ba
Submitter: Zuul
Branch: master

commit f9e0f8a976b82088ef095a69cd1fa892cddde3ba
Author: Rikimaru Honjo <email address hidden>
Date: Wed Jan 15 10:48:14 2020 +0000

    Allow to evacuate without specifying a target host

    When the evacuate is run without specifying a target host, horizon
    sets an empty string for target host. But the evacuate api doesn't
    allow an empty string. As a result, nova returns "HTTP 400 Bad
    request".

    So this patch sets None as the target host when it isn't specified.

    Change-Id: Ia865a6c02e206fa49efc3095e8d3488f5638d0e3
    Closes-Bug: 1793694

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/704503

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/704505

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/704727

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (stable/stein)

Change abandoned by Rikimaru Honjo (<email address hidden>) on branch: stable/stein
Review: https://review.opendev.org/704505
Reason: I fixed Change-id in the following patch.

https://review.opendev.org/#/c/704727/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/704728

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (stable/train)

Change abandoned by Rikimaru Honjo (<email address hidden>) on branch: stable/train
Review: https://review.opendev.org/704503
Reason: Hello Akihiro,

Sorry for writing wrong Change-id.

I fixed Change-id in the following patch.

https://review.opendev.org/#/c/704728/

So I abandon this patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/train)

Reviewed: https://review.opendev.org/704728
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=e058e381607e93439a59f47c36e6a9b7cf61cc71
Submitter: Zuul
Branch: stable/train

commit e058e381607e93439a59f47c36e6a9b7cf61cc71
Author: Rikimaru Honjo <email address hidden>
Date: Wed Jan 15 10:48:14 2020 +0000

    Allow to evacuate without specifying a target host

    When the evacuate is run without specifying a target host, horizon
    sets an empty string for target host. But the evacuate api doesn't
    allow an empty string. As a result, nova returns "HTTP 400 Bad
    request".

    So this patch sets None as the target host when it isn't specified.

    Change-Id: Ia865a6c02e206fa49efc3095e8d3488f5638d0e3
    Closes-Bug: 1793694
    (cherry picked from commit f9e0f8a976b82088ef095a69cd1fa892cddde3ba)

tags: added: in-stable-train
tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/stein)

Reviewed: https://review.opendev.org/704727
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=42d9a8d2e8736c5a8e94eaf7074755a1add3922b
Submitter: Zuul
Branch: stable/stein

commit 42d9a8d2e8736c5a8e94eaf7074755a1add3922b
Author: Rikimaru Honjo <email address hidden>
Date: Wed Jan 15 10:48:14 2020 +0000

    Allow to evacuate without specifying a target host

    When the evacuate is run without specifying a target host, horizon
    sets an empty string for target host. But the evacuate api doesn't
    allow an empty string. As a result, nova returns "HTTP 400 Bad
    request".

    So this patch sets None as the target host when it isn't specified.

    Change-Id: Ia865a6c02e206fa49efc3095e8d3488f5638d0e3
    Closes-Bug: 1793694
    (cherry picked from commit f9e0f8a976b82088ef095a69cd1fa892cddde3ba)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 18.1.0

This issue was fixed in the openstack/horizon 18.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.