Bug 1155466 - operation failed, when adding admin@internal via REST
Summary: operation failed, when adding admin@internal via REST
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 3.6.0
Assignee: Yair Zaslavsky
QA Contact: Ondra Machacek
URL:
Whiteboard: infra
Depends On:
Blocks: oVirt-AAA-rewrite
TreeView+ depends on / blocked
 
Reported: 2014-10-22 07:59 UTC by Ondra Machacek
Modified: 2016-02-10 19:01 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-08 15:33:29 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ondra Machacek 2014-10-22 07:59:44 UTC
Description of problem:


Version-Release number of selected component (if applicable):
vt6

How reproducible:
always

Steps to Reproduce:
curl -k -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -H "Filter: $filter" -d "<user><domain><name>internal</name></domain><user_name>admin</user_name></user>" -u $U $URL/users


Actual results:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
    <detail>[]</detail>
</fault>


Expected results:
no error. info that user already is in system.

Additional info:

Comment 1 Oved Ourfali 2014-10-23 05:59:52 UTC
> 
> Expected results:
> no error. info that user already is in system.

There should be an error, but specifying that the user already exists in the system.

Comment 2 Alon Bar-Lev 2014-12-30 09:59:21 UTC
Works for me at least in master, can you please check upstream 3.5 branch?

$ curl http://admin%40internal:engine@localhost:8080/ovirt-engine/api/users -H "Content-Type: application/xml" -X POST -d "<user><domain><name>internal</name></domain><user_name>admin</user_name></user>"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user href="/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc" id="fdfc627c-d875-11e0-90f0-83df133b58cc">
    <name>admin</name>
    <link href="/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc/permissions" rel="permissions"/>
    <link href="/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc/roles" rel="roles"/>
    <link href="/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc/tags" rel="tags"/>
    <domain href="/ovirt-engine/api/domains/696E7465726E616C" id="696E7465726E616C">
        <name>internal</name>
    </domain>
    <domain_entry_id>66646663363237632D643837352D313165302D393066302D383364663133336235386363</domain_entry_id>
    <namespace>*</namespace>
    <user_name>admin@internal</user_name>
    <principal>admin</principal>
</user>

Comment 3 Ondra Machacek 2015-01-08 07:26:40 UTC
I can see the same as you, but it display result same as when user is created.
Should be displayed error with message, that user already exists?

Comment 4 Alon Bar-Lev 2015-01-08 07:56:47 UTC
no, by "design" for some reason, add user of existing user is allowed, and it cause refresh of that user, now that there is no sync, this operation is simply void. as long as you see the same id for user it is ok.


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