Bug 1266135 - [vmconsole][helper] key list entity is incorrect
Summary: [vmconsole][helper] key list entity is incorrect
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: VMConsole
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ovirt-3.6.1
: 3.6.1
Assignee: Francesco Romani
QA Contact: Nikolai Sednev
URL:
Whiteboard: virt
Depends On:
Blocks: 1223671
TreeView+ depends on / blocked
 
Reported: 2015-09-24 14:50 UTC by Alon Bar-Lev
Modified: 2016-02-10 19:23 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-16 12:21:48 UTC
oVirt Team: Virt
Embargoed:
michal.skrivanek: ovirt-3.6.z?
rule-engine: planning_ack?
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 46698 0 master MERGED sercon: servlet: db: send correct login name Never
oVirt gerrit 46779 0 ovirt-engine-3.6 MERGED sercon: servlet: db: send correct login name Never

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.


Note You need to log in before you can comment on or make changes to this bug.