Bug 859233 - ovirt-engine-restapi : two permissions has the same permit ID
ovirt-engine-restapi : two permissions has the same permit ID
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
3.1.0
Unspecified Unspecified
urgent Severity urgent
: ---
: ---
Assigned To: Oved Ourfali
Oded Ramraz
infra
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-20 16:53 EDT by Oded Ramraz
Modified: 2016-02-10 14:12 EST (History)
10 users (show)

See Also:
Fixed In Version: si20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-04 15:01:30 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Oded Ramraz 2012-09-20 16:53:52 EDT
Description of problem:

two permissions contain the same permit ID :

<permit id="1104"><name>delete_disk</name><administrative>false</administrative></permit>
<permit id="1104"><name>port_mirroring</name><administrative>true</administrative></permit>

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Itamar Heim 2012-09-20 17:15:13 EDT
oved/yair - maybe also add a unitest to check no duplicate permits in the enum?
(i'd add this unitest to run on all enums actually!)

this will require a release note, since we won't handle upgrade on this...
Comment 2 Oved Ourfali 2012-09-23 02:22:34 EDT
The problem is in the restapi side, and not backend side.
There is a PermitType enum in the restapi-definition project, and the permit ID there for the port mirroring is wrong.

Movig the bug to restapi component.
Comment 3 Itamar Heim 2012-09-23 02:53:38 EDT
why would we maintain these numbers manually in the code?
Comment 4 Michael Pasternak 2012-09-23 03:29:13 EDT
leftover from 2.3, enum member's id should be inherited from the BE
enum, and not being specified in the client side decorating enum,

Oved, please remove id from the org.ovirt.engine.api.model.PermitType 
and inject it in the PermitMapper according to the ActionGroup,

thanks.
Comment 5 Oved Ourfali 2012-09-23 06:08:12 EDT
Posted fix:
http://gerrit.ovirt.org/#/c/8128/
Comment 6 Oved Ourfali 2012-09-23 06:33:37 EDT
Commit: c41d40f1483a861d5a007f0579c5d40fcf3c3ce0

http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=c41d40f1483a861d5a007f0579c5d40fcf3c3ce0
Comment 9 Oded Ramraz 2012-10-09 10:05:48 EDT
<permit id="1104"><name>delete_disk</name><administrative>false</administrative></permit><permit id="1200"><name>port_mirroring</name><administrative>true</administrative></permit>

The ID's are different now

Verified si20

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