Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1066040

Summary: Update role call does not work properly if updating permission field
Product: [Retired] Pulp Reporter: Ina Panova <ipanova>
Component: API/integrationAssignee: Sayli Karmarkar <skarmark>
Status: CLOSED CURRENTRELEASE QA Contact: Ina Panova <ipanova>
Severity: unspecified Docs Contact:
Priority: medium    
Version: unspecifiedCC: bcourt, cperry, mhrivnak, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: 2.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-09 06:56:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ina Panova 2014-02-17 14:46:24 UTC
Description of problem:
when trying to update role's permissions the PUT request works as expected and in the response body recent change is visible. But when doing GET on a single role in the response body permissions are 'null'.

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

pulp-server-2.4.0-0.2.alpha.git.8.71f8305.fc19.noarch
How reproducible:


Steps to Reproduce:
1. create a role
2. update role with new permissions
3. retrieve this role
4. see that the update did not work

Actual results:
update of role's permission does not work

Expected results:
update of role's permission should work normally

Additional info:

$ curl -H "Accept: application/json"  PUT -k -u admin:admin  -d '{"delta":{"permissions":{"/":["CREATE","DELETE"]}}}' 'https://example.com/pulp/api/v2/roles/myrole/' | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   249  100   198  100    51    164     42  0:00:01  0:00:01 --:--:--   198
{
    "_href": "/pulp/api/v2/roles/myrole/", 
    "_id": {
        "$oid": "53021345356cdf01fefddd22"
    }, 
    "_ns": "roles", 
    "description": null, 
    "display_name": "myrole", 
    "id": "myrole", 
    "permissions": {
        "/": [
            "CREATE", 
            "DELETE"
        ]
    }
}


$ curl -H "Accept: application/json" -X GET -k -u admin:admin  'https://example.com/pulp/api/v2/roles/myrole/' | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   203  100   203    0     0    207      0 --:--:-- --:--:-- --:--:--   247
{
    "_href": "/pulp/api/v2/roles/myrole/", 
    "_id": {
        "$oid": "53021345356cdf01fefddd22"
    }, 
    "_ns": "roles", 
    "description": null, 
    "display_name": "myrole", 
    "id": "myrole", 
    "permissions": {
        "/": [
            null, 
            null
        ]
    }, 
    "users": []
}

Comment 1 Michael Hrivnak 2014-02-28 14:18:21 UTC
https://github.com/pulp/pulp/pull/820

Comment 2 Jeff Ortel 2014-04-03 13:36:27 UTC
build: 2.4.0-0.7.beta

Comment 3 Ina Panova 2014-04-14 11:33:08 UTC
Tested in pulp-server-2.4.0-0.8.beta.fc20.noarch

$ curl -H "Accept: application/json" -X PUT -k -u admin:admin  -d '{"delta":{"permissions":{"/":["CREATE","DELETE"]}}}' 'https://example.com/pulp/api/v2/roles/myrole/' | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   427  100   376  100    51    393     53 --:--:-- --:--:-- --:--:--   393
{
    "_href": "/pulp/api/v2/roles/myrole/",
    "args": [
        "Update Keyword [permissions] is not supported"
    ],
    "error": {
        "code": "PLP0000",
        "data": {},
        "description": "Update Keyword [permissions] is not supported",
        "sub_errors": []
    },
    "error_message": "Update Keyword [permissions] is not supported",
    "exception": null,
    "http_request_method": "PUT",
    "http_status": 400,
    "traceback": null
}

Moving to Verified.

Comment 4 Randy Barlow 2014-08-09 06:56:59 UTC
This has been fixed in Pulp 2.4.0-1.