[sahara] node group template shows redundant process tab

Bug #1398695 reported by Ken Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Nikita Konovalov

Bug Description

When we want to edit process configurations in Horizon. For example, we add a "Namenode" process in CDH plugin, we suppose we will only have "NAMENODE" tab shown in this page besides the "Create Node Group Template" tab. However, we will have two tabs shown instead one. They are "NAMENODE" and "SECONDARYNAMENODE". The reason is in nodegroup_templates.html, function get_service_tab is defined as:
            function get_service_tab(service) {
                return $("a").filter(function (idx, e) {
                    return $(e).attr("data-target") && $(e).attr("data-target").indexOf(service.toLowerCase()) != -1
                }).closest("li");
            }
by this way it will get all names including "NAMENODE" instead of precise matching. This behavior is confusing and not desired, and we need to replace it by precise matching.

tags: added: sahara
Revision history for this message
Nikunj Aggarwal (nikunj2512) wrote :

Can you give steps to reproduce this issue more briefly??

Also please update the explanation of the bug.

Revision history for this message
Ken Chen (ken-chen-i) wrote :

To reproduce this issue, you can do it by below step:
Step1: Enable "cdh" plugin in Sahara by add cdh in /etc/sahara/sahara.conf plugins line, like "plugins = cdh,vanilla,hdp,fake", and then restart sahara. This issue is not caused by CDH plugin, but as I know, currently it only happens to CDH node group.
Step2: in Project-> Data Processing-> Node Group Templates, use “Create Template” to create a node group template.
Step3: Then choose “Cloudera Plugin” and “5”, and click “Create”.
Step4: In the processes list, check “NAMENODE” but leave “SECONDARYNAMDENODE” unchecked.
Now you will expect to see only “NAMENODE Parameters” tab shown, but “SECONDARYNAMENODE Parameters” is also shown.
The bug is that below code

“return $(e).attr("data-target") && $(e).attr("data-target").indexOf(service.toLowerCase()) != -1”

will get both “SECONDARYNAMENODE” and “NAMENODE”, which both can match “NAMENODE” substring.

Changed in horizon:
status: New → Confirmed
assignee: nobody → Andrew Lazarev (alazarev)
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/142950

Changed in horizon:
status: Confirmed → In Progress
Changed in horizon:
assignee: Andrew Lazarev (alazarev) → Nikita Konovalov (nkonovalov)
David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → High
tags: added: kilo-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/142950
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=c7354a144f125674b4b2203bb73ca3e5f70125df
Submitter: Jenkins
Branch: master

commit c7354a144f125674b4b2203bb73ca3e5f70125df
Author: Andrew Lazarev <email address hidden>
Date: Thu Dec 18 17:13:54 2014 -0800

    [Sahara] Fixed tab selection in case of processes names conflict

    We need to have delimeters around service name because it is
    possible that one process name is a substring of another process
    name (e.g. 'namenode' and 'secondarynamenode'). Implemented the
    easiest fix by adding delimeters currently used in data-target
    attribute.

    Change-Id: Iae734d5f2f34f492fe12a566ed636fd7ad525851
    Closes-Bug: #1398695

Changed in horizon:
status: In Progress → Fix Committed
Changed in horizon:
milestone: none → liberty-1
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-1 → 8.0.0
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.