wrong link to attached vm from volumes list

Bug #1567317 reported by Martin Pavlásek
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Akihiro Motoki

Bug Description

1. log in as 'demo' user
2. create instance 'test'
3. create volume 'test_volume'
4. via Manage attachments dialogue, attach 'test_volume' to 'test' instance
5. log out
6. log in as 'admin'
7. navigate Admin - System - Volumes
8. click to link 'test' (name of VM) under 'Attached To' column

Now let's think about to terminate VM, that has 'test_volume' attached.

Current results:
you are redirected to:
/dashboard/project/instances/uuid-of-instace/

It is wrong, because 'admin' user is part of 'admin' project only. 'demo' user is member of 'demo' project only as well. So the link shows everything as expected, but if you try to terminate instance by drop-down menu, you will not see any notification (success neither failure) and actually you are redirected to:
/dashboard/project/instances/

Expected result:
click to VM name in list of volumes will navigate user to:
/dashboard/admin/instances/uuid-of-instace/detail

Attempt to terminate the VM will be succeded, notification would be displayed and user will land on:
/dashboard/admin/instances/

Revision history for this message
vebutton (vincent-button) wrote :

Confirmed. "Admin->System->Volumes->Attached to" link should navigate to "Admin->System->Instances->Project->Name" instead of "Project->Compute->Instances->Instance Name".

Changed in horizon:
status: New → Incomplete
status: Incomplete → Confirmed
assignee: nobody → vebutton (vincent-button)
Changed in horizon:
importance: Undecided → Low
milestone: none → next
Revision history for this message
Kranthi Dhanala (kranthi-dhanala92) wrote :

I see the one way to resolve the bug is to make changes to get_attachment_name method in project/volumes/volumes/tables.py which hard coded "horizon:project:instances:detail" link but it can be changed based on request.path info (If path is /admin/volumes/ or /project/volumes and adjust the link accordingly
I don't know if relying on request.path is a good idea though

Another way is to have a custom AttachmentColumn class functionality for admin/volumes in admin similar to project/volumes

As a beginner, I am curious to know which approach is better or if there is another good solution to fix it.

Revision history for this message
vebutton (vincent-button) wrote :

Thanks for the code review.

Let's see if the custom AttachmentColumn class will work.

Using request.path would work, and there are 2 ways to do it.
1, test explicitly on request.path and have different hard coded responses. This would be ugly because we'd see a hard coded "admin" string in the project/volumes/volumes/tables.py file
2, string substitute part of the contents of request.path into the hard coded value. This would make for unreadable code

Another option is to see if we can inherit a variable with the correct hard coded string from admin/volumes/volumes/tables.py. I think we got unexpectedly cryptic values when trying this.

Revision history for this message
vebutton (vincent-button) wrote :

Duplicating AttachmentColumn in admin scope definitely solves the problem. I'll put the code up for review shortly.

Revision history for this message
Akihiro Motoki (amotoki) wrote :

Clearing the assignee due to long inactivity

Changed in horizon:
assignee: vebutton (vincent-button) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/521365

Changed in horizon:
assignee: nobody → Akihiro Motoki (amotoki)
status: Confirmed → In Progress
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: next → queens-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to horizon (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/521366

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

Reviewed: https://review.openstack.org/521365
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=4693a1897593ee9c0491a29166dd395e3393fb0a
Submitter: Zuul
Branch: master

commit 4693a1897593ee9c0491a29166dd395e3393fb0a
Author: Akihiro Motoki <email address hidden>
Date: Sun Nov 19 11:20:11 2017 +0000

    Fix wrong link to VM in admin volume table

    Change-Id: I1f224fa544f80f749e692b321b4d4f46ea1ab940
    Closes-Bug: #1567317

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 13.0.0.0b2

This issue was fixed in the openstack/horizon 13.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to horizon (master)

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

commit ed5adbe0bda91ea91657d666ab497ee1db4f27aa
Author: Akihiro Motoki <email address hidden>
Date: Sun Nov 19 12:07:33 2017 +0000

    Fix wrong link to VM in admin volume detail

    Change-Id: Iadf007433afbe8bc08a4ada39f30d1448a98ebf5
    Related-Bug: #1567317

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

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/529053

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to horizon (stable/pike)

Related fix proposed to branch: stable/pike
Review: https://review.openstack.org/529054

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to horizon (stable/pike)

Reviewed: https://review.openstack.org/529054
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=1e0e9b4fd7096e7a0c8749cb36f7e0dc7bad5c6d
Submitter: Zuul
Branch: stable/pike

commit 1e0e9b4fd7096e7a0c8749cb36f7e0dc7bad5c6d
Author: Akihiro Motoki <email address hidden>
Date: Sun Nov 19 12:07:33 2017 +0000

    Fix wrong link to VM in admin volume detail

    Change-Id: Iadf007433afbe8bc08a4ada39f30d1448a98ebf5
    Related-Bug: #1567317
    (cherry picked from commit ed5adbe0bda91ea91657d666ab497ee1db4f27aa)

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

Reviewed: https://review.openstack.org/529053
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=ebdd258e56c663c86ab4fff138948401d97f1f08
Submitter: Zuul
Branch: stable/pike

commit ebdd258e56c663c86ab4fff138948401d97f1f08
Author: Akihiro Motoki <email address hidden>
Date: Sun Nov 19 11:20:11 2017 +0000

    Fix wrong link to VM in admin volume table

    Change-Id: I1f224fa544f80f749e692b321b4d4f46ea1ab940
    Closes-Bug: #1567317
    (cherry picked from commit 4693a1897593ee9c0491a29166dd395e3393fb0a)

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

This issue was fixed in the openstack/horizon 12.0.3 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.