Bug 1266135 - [vmconsole][helper] key list entity is incorrect
[vmconsole][helper] key list entity is incorrect
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine
Classification: oVirt
Component: VMConsole (Show other bugs)
3.6.0
Unspecified Unspecified
low Severity low (vote)
: ovirt-3.6.1
: 3.6.1
Assigned To: Francesco Romani
Nikolai Sednev
virt
: Triaged
Depends On:
Blocks: 1223671
  Show dependency treegraph
 
Reported: 2015-09-24 10:50 EDT by Alon Bar-Lev
Modified: 2016-02-10 14:23 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-16 07:21:48 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
michal.skrivanek: ovirt‑3.6.z?
rule-engine: planning_ack?
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 46698 master MERGED sercon: servlet: db: send correct login name Never
oVirt gerrit 46779 ovirt-engine-3.6 MERGED sercon: servlet: db: send correct login name Never

  None (edit)
Description Alon Bar-Lev 2015-09-24 10:50:57 EDT
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@redhat.com-authz' user.

I do not know how to fix that.
Comment 1 Francesco Romani 2015-09-24 11:32:12 EDT
(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@redhat.com-authz' 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 11:35:07 EDT
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 11:45:55 EDT
(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 04:07:41 EDT
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 04:59:27 EDT
This is trivial fix, already reviewed. No reason to defer.
Comment 6 Francesco Romani 2015-10-15 10:14:48 EDT
patches merged -> MODIFIED
Comment 7 Nikolai Sednev 2015-11-25 01:09:47 EST
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 05:23:27 EST
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 11:16:15 EST
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 07:21:48 EST
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.