Bug 1266135

Summary: [vmconsole][helper] key list entity is incorrect
Product: [oVirt] ovirt-engine Reporter: Alon Bar-Lev <alonbl>
Component: VMConsoleAssignee: Francesco Romani <fromani>
Status: CLOSED CURRENTRELEASE QA Contact: Nikolai Sednev <nsednev>
Severity: low Docs Contact:
Priority: low    
Version: 3.6.0CC: alonbl, bugs, fromani, iheim, michal.skrivanek
Target Milestone: ovirt-3.6.1Keywords: Triaged
Target Release: 3.6.1Flags: michal.skrivanek: ovirt-3.6.z?
rule-engine: planning_ack?
rule-engine: devel_ack+
rule-engine: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-16 12:21:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1223671    

Description Alon Bar-Lev 2015-09-24 14:50:57 UTC
based on api the user name should be provided in entity not username json field.

I tried to fix VMConsoleProxyServlet:

-                            jsonUser.put("entity", "user-id");
-                            jsonUser.put("username", profile.getLoginName());
+                            jsonUser.put("entity", profile.getLoginName());

however, I do not understand how user name is obtained from profile,  it is not a field that should be there, it should be gotten from Users table '%s@%s' % (username, domain) fields.

now I get 'Alon' for my 'abarlev' user.

I do not know how to fix that.

Comment 1 Francesco Romani 2015-09-24 15:32:12 UTC
(In reply to Alon Bar-Lev from comment #0)
> based on api the user name should be provided in entity not username json
> field.
> 
> I tried to fix VMConsoleProxyServlet:
> 
> -                            jsonUser.put("entity", "user-id");
> -                            jsonUser.put("username",
> profile.getLoginName());
> +                            jsonUser.put("entity", profile.getLoginName());
> 
> however, I do not understand how user name is obtained from profile,  it is
> not a field that should be there, it should be gotten from Users table
> '%s@%s' % (username, domain) fields.
> 
> now I get 'Alon' for my 'abarlev' user.
> 
> I do not know how to fix that.

The field is not actually in the user_profiles table, we use the user_profiles_view for this purpose, which is accessed by the Get*UserProfile* SPs.

Please check packaging/dbscripts/create_views.sql

Comment 2 Alon Bar-Lev 2015-09-24 15:35:07 UTC
ok, please extract the username and domain and construct username@profile, currently it extracts the first name or something similar.

Comment 3 Francesco Romani 2015-09-24 15:45:55 UTC
(In reply to Alon Bar-Lev from comment #2)
> ok, please extract the username and domain and construct username@profile,
> currently it extracts the first name or something similar.

Done, patch posted.

Comment 4 Michal Skrivanek 2015-09-29 08:07:41 UTC
no impact to functionality, but it's a new feature so let's fix it as soon as practical

Comment 5 Alon Bar-Lev 2015-09-29 08:59:27 UTC
This is trivial fix, already reviewed. No reason to defer.

Comment 6 Francesco Romani 2015-10-15 14:14:48 UTC
patches merged -> MODIFIED

Comment 7 Nikolai Sednev 2015-11-25 06:09:47 UTC
Hi Francesco,
Please provide me with the reproduction steps for this bug, so I could verify the bug.

Comment 8 Francesco Romani 2015-11-25 10:23:27 UTC
This is a purely internal change. I'm not aware, at the moment, of any user-visible impact. The only way I can think of to verify this change is to manuyally run the ovirt-vmconsole-list.py helper and check the output.

0. make sure Engine is running, keys are registered, the flow works
1. run the tool as root, example:
   # /usr/libexec/ovirt-vmconsole-proxy-helper/ovirt-vmconsole-list.py keys
2. check the output as per description

Comment 10 Nikolai Sednev 2015-12-07 16:16:15 UTC
Works for me on these components:
rhevm-3.6.1.1-0.1.el6.noarch
ovirt-host-deploy-java-1.4.1-1.el6ev.noarch
ovirt-vmconsole-1.0.0-1.el6ev.noarch
ovirt-host-deploy-1.4.1-1.el6ev.noarch
ovirt-vmconsole-proxy-1.0.0-1.el6ev.noarch
ovirt-engine-extension-aaa-jdbc-1.0.4-1.el6ev.noarch

Comment 11 Sandro Bonazzola 2015-12-16 12:21:48 UTC
According to verification status and target milestone this issue should be fixed in oVirt 3.6.1. Closing current release.