Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1564453 - autoAttach attribute of the activation is set to null no when you try to set it to true/false
Summary: autoAttach attribute of the activation is set to null no when you try to set ...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 2.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Sonali Dhome
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-06 10:35 UTC by Shwetha Kallesh
Modified: 2019-09-11 13:28 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-11 13:28:12 UTC


Attachments (Terms of Use)

Description Shwetha Kallesh 2018-04-06 10:35:52 UTC
Description of problem:
autoAttach attribute of the activation is set to null no when you try to set it to true/false

Version-Release number of selected component (if applicable):
subscription management server: 2.3.4-1


How reproducible:


Steps to Reproduce:
[root@shwetha-candlepin server]# curl --stderr /dev/null --insecure --user testuser1:password --request POST --data '{"name":"testuser1_admin-","autoAttach":"false"}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/admin/activation_keys
{
  "created" : "2018-04-06T10:14:01+0000",
  "updated" : "2018-04-06T10:14:01+0000",
  "id" : "8acce3d3629a6d3001629a72dd3d10e8",
  "name" : "testuser1_admin-",
  "description" : null,
  "owner" : {
    "id" : "8acce3d3629a6d3001629a6e59a90004",
    "key" : "admin",
    "displayName" : "Admin Owner",
    "href" : "/owners/admin"
  },
  "serviceLevel" : null,
  "autoAttach" : null,      -------> autoAttach is set to null and not false
  "pools" : [ ],
  "contentOverrides" : [ ],
  "releaseVer" : {
    "releaseVer" : null
  },
  "products" : [ ]
 
 
 
}[root@shwetha-candlepin server]#curl --stderr /dev/null --insecure --user testuser1:password --request POST --data '{"name":"testuser1_snowwhite-ActivationKey","autoAttach":"true"}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite/activation_keys
{
  "created" : "2018-04-06T10:15:22+0000",
  "updated" : "2018-04-06T10:15:22+0000",
  "id" : "8acce3d3629a6d3001629a74186d10ea",
  "name" : "testuser1_snowwhite-ActivationKey",
  "description" : null,
  "owner" : {
    "id" : "8acce3d3629a6d3001629a6e599d0003",
    "key" : "snowwhite",
    "displayName" : "Snow White",
    "href" : "/owners/snowwhite"
  },
  "serviceLevel" : null,
  "autoAttach" : null,         -------> autoAttach is set to null and not true
  "pools" : [ ],
  "contentOverrides" : [ ],
  "releaseVer" : {
    "releaseVer" : null
  },
  "products" : [ ]

Actual results:


Expected results:


Additional info:

Comment 1 Kevin Howell 2018-04-09 14:15:19 UTC
You've demonstrated "true" and "false" (both strings). What about as the JSON literals (without quotes)?

Comment 2 Shwetha Kallesh 2018-04-09 14:29:13 UTC
Still null:

[root@localhost ~]# curl -k --request POST --user admin:admin --data '{"name":"truekey","autoAttach": true}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/admin/activation_keys | python -mjson.tool

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
131   489    0   489    0    37    489     37 --:--:-- --:--:-- --:--:--   716
{
    "autoAttach": null,              -----------> null and not true
    "contentOverrides": [], 
    "created": "2018-04-09T14:18:19+0000", 
    "description": null, 
    "id": "8acce3d362aa93090162aac599ca0000", 
    "name": "truekey", 
    "owner": {
        "displayName": "Admin Owner", 
        "href": "/owners/admin", 
        "id": "8acce3d362aa61090162aa629d250003", 
        "key": "admin"
    }, 
    "pools": [], 
    "products": [], 
    "releaseVer": {
        "releaseVer": null
    }, 
    "serviceLevel": null, 
    "updated": "2018-04-09T14:18:19+0000"
}

Comment 4 Shwetha Kallesh 2019-09-11 13:28:12 UTC
I cant reproduce it either with following version of candlepin  2.8.0-1, so closing the bug as worksforme

[shwetha@shwetha-laptop rhsm-qe]$ curl -k --request POST --user admin:admin --data '{"name":"truekey","autoAttach": true}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-workstation.usersys.redhat.com:8443/candlepin/owners/admin/activation_keys | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   579    0   542  100    37    123      8  0:00:04  0:00:04 --:--:--   132
{
    "addOns": [],
    "autoAttach": true,
    "contentOverrides": [],
    "created": "2019-09-11T13:23:18+0000",
    "description": null,
    "id": "8ac6a3a96c8ae2c7016d207e1a500010",
    "name": "truekey",
    "owner": {
        "displayName": "Admin Owner",
        "href": "/owners/admin",
        "id": "8ac6a3a96c6614cf016c6614ed760002",
        "key": "admin"
    },
    "pools": [],
    "products": [],
    "releaseVer": {
        "releaseVer": null
    },
    "role": null,
    "serviceLevel": null,
    "updated": "2019-09-11T13:23:18+0000",
    "usage": null
}
[shwetha@shwetha-laptop rhsm-qe]$ curl --stderr /dev/null --insecure --user testuser1:password --request POST --data '{"name":"testuser1_admin-","autoAttach":"false"}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-workstation.usersys.redhat.com:8443/candlepin/owners/admin/activation_keys
{
  "created" : "2019-09-11T13:24:22+0000",
  "updated" : "2019-09-11T13:24:22+0000",
  "id" : "8ac6a3a96c8ae2c7016d207f167d0011",
  "name" : "testuser1_admin-",
  "description" : null,
  "owner" : {
    "id" : "8ac6a3a96c6614cf016c6614ed760002",
    "key" : "admin",
    "displayName" : "Admin Owner",
    "href" : "/owners/admin"
  },
  "serviceLevel" : null,
  "usage" : null,
  "role" : null,
  "addOns" : [ ],
  "autoAttach" : false,
  "pools" : [ ],
  "contentOverrides" : [ ],
  "products" : [ ],
  "releaseVer" : {
    "releaseVer" : null
  }
}[


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