Bug 878234

Summary: Consumer group package_install , update and uninstall not returning correct result
Product: [Retired] Pulp Reporter: Partha Aji <paji>
Component: consumersAssignee: Jeff Ortel <jortel>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: high Docs Contact:
Priority: high    
Version: MasterCC: jason.dobies, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: 2.1.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-10 15:44:13 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:
Bug Depends On:    
Bug Blocks: 854726    

Description Partha Aji 2012-11-19 22:04:33 UTC
In pulp v1, package_install on a consumer group would return (http://www.pulpproject.org/ug/UGREST-ConsumerGroups.html#InstallPackages)

{
  "tasks": [<list of tasks with a consumer_id attached>], 
  "id": "c48c1467-841f-41b6-a1d5-2dbd3c638ef9"
}


In pulp v2 beta, this call does not  return a list of tasks or a job id.

POST Via 

RestClient.post "https://<fqdn>/pulp/api/v2/consumer_groups/ACME_Corporation-boo-ecf84e1d/actions/content/install//", "{\"units\":[{\"unit_key\":{\"name\":\"fooo\"},\"type_id\":\"rpm\"}],\"options\":{}}", "Accept"=>"application/json", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"OAuth oauth_body_hash=\"2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D\", oauth_consumer_key=\"katello\", oauth_nonce=\"MHTLoIBXqxXy7u41GdCotImBjaBVhCpH6c7Kyo8knSw\", oauth_signature=\"rmlK5fLS8Jfgq7jdpkDmTLUhirE%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1353353738\", oauth_version=\"1.0\"", "Content-Length"=>"76", "Content-Type"=>"application/json", "pulp-user"=>"admin"

expected

{
  "tasks": [<list of tasks with a consumer_id attached>], 
  "id": "c48c1467-841f-41b6-a1d5-2dbd3c638ef9"
}


actual 
{one task id}

Comment 1 Sayli Karmarkar 2013-01-23 09:56:38 UTC
Added functionality to record and return a list of install call requests.

Comment 2 Sayli Karmarkar 2013-02-05 09:08:44 UTC
Merged pull request. Moving to modified. 

commit 198860b602099adf553e745cd11dccf28ee5573b
Merge: 373ee00 d1c0562
Author: skarmark <skarmark>
Date:   Tue Feb 5 01:06:42 2013 -0800

    Merge pull request #264 from pulp/skarmark-878234
    
    878234 - added consumer group itineraries and updated group content install apis to return a list of call requests, also added unit tests

Comment 3 Jeff Ortel 2013-02-05 20:56:59 UTC
build: 2.1.0-0.3.alpha

Comment 4 Sayli Karmarkar 2013-04-04 19:29:50 UTC
Preethi, 

for testing you should use -

Rest URI :

https://<server_name>/pulp/api/v2/consumer_groups/<group-id>/actions/content/<install/update/uninstall>/

Example body:

{'units':[{'unit_key':{'name':<package_name>},'type_id':'rpm'}], 'options':{} }

Expected return value: list of tasks for each consumer in the group

Comment 5 Jeff Ortel 2013-05-28 19:06:44 UTC
https://github.com/pulp/pulp/pull/498

Comment 6 Jeff Ortel 2013-05-29 17:45:13 UTC
build: 2.1.2-0.1.beta

Comment 7 Preethi Thomas 2013-05-30 00:50:35 UTC
2013-05-29 20:49:05,701 - INFO - POST request to /pulp/api/v2/consumer_groups/consumer-grp/actions/content/install/ with parameters {"units": [{"unit_key": {"name": "camel"}, "type_id": "rpm"}], "options": {"apply": true, "reboot": false, "importkeys": false}}
2013-05-29 20:49:05,702 - INFO - Response status : 202 

2013-05-29 20:49:05,702 - INFO - Response body :
 [
  {
    "task_group_id": "f544ab9a-7c44-4ae6-be92-b78e634a7048", 
    "call_request_id": "bff99433-82b7-4264-8173-68f021ef5e2b", 
    "exception": null, 
    "_href": "/pulp/api/v2/task_groups/f544ab9a-7c44-4ae6-be92-b78e634a7048/", 
    "task_id": "bff99433-82b7-4264-8173-68f021ef5e2b", 
    "call_request_tags": [
      "pulp:consumer:alicia", 
      "pulp:action:unit_install"
    ], 
    "reasons": [], 
    "start_time": null, 
    "traceback": null, 
    "schedule_id": null, 
    "finish_time": null, 
    "state": "waiting", 
    "result": null, 
    "dependency_failures": {}, 
    "call_request_group_id": "f544ab9a-7c44-4ae6-be92-b78e634a7048", 
    "progress": {}, 
    "principal_login": "admin", 
    "response": "accepted", 
    "tags": [
      "pulp:consumer:alicia", 
      "pulp:action:unit_install"
    ]
  }, 
  {
    "task_group_id": "f544ab9a-7c44-4ae6-be92-b78e634a7048", 
    "call_request_id": "f85e65eb-09ed-42e3-8601-dad01bd9c88c", 
    "exception": null, 
    "_href": "/pulp/api/v2/task_groups/f544ab9a-7c44-4ae6-be92-b78e634a7048/", 
    "task_id": "f85e65eb-09ed-42e3-8601-dad01bd9c88c", 
    "call_request_tags": [
      "pulp:consumer:anna", 
      "pulp:action:unit_install"
    ], 
    "reasons": [], 
    "start_time": null, 
    "traceback": null, 
    "schedule_id": null, 
    "finish_time": null, 
    "state": "waiting", 
    "result": null, 
    "dependency_failures": {}, 
    "call_request_group_id": "f544ab9a-7c44-4ae6-be92-b78e634a7048", 
    "progress": {}, 
    "principal_login": "admin", 
    "response": "accepted", 
    "tags": [
      "pulp:consumer:anna", 
      "pulp:action:unit_install"
    ]
  }
]

Comment 8 Preethi Thomas 2013-05-30 01:29:35 UTC
Install 


>>> pic.POST('/v2/consumer_groups/consumer-grp/actions/content/install/',body={'units':[{'unit_key':{'name':'bear'},'type_id':'rpm'}], 'options':{} })
Request Body
{
  "units": [
    {
      "unit_key": {
        "name": "bear"
      }, 
      "type_id": "rpm"
    }
  ], 
  "options": {}
}
Response Body
[
  {
    "task_group_id": "7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4", 
    "call_request_id": "1437f0be-4e7c-4a13-ac63-949fd02be28a", 
    "exception": null, 
    "_href": "/pulp/api/v2/task_groups/7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4/", 
    "task_id": "1437f0be-4e7c-4a13-ac63-949fd02be28a", 
    "call_request_tags": [
      "pulp:consumer:alicia", 
      "pulp:action:unit_install"
    ], 
    "reasons": [], 
    "start_time": null, 
    "traceback": null, 
    "schedule_id": null, 
    "finish_time": null, 
    "state": "waiting", 
    "result": null, 
    "dependency_failures": {}, 
    "call_request_group_id": "7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4", 
    "progress": {}, 
    "principal_login": "admin", 
    "response": "accepted", 
    "tags": [
      "pulp:consumer:alicia", 
      "pulp:action:unit_install"
    ]
  }, 
  {
    "task_group_id": "7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4", 
    "call_request_id": "320bde47-d2ee-451b-a0ac-a71dd0b59864", 
    "exception": null, 
    "_href": "/pulp/api/v2/task_groups/7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4/", 
    "task_id": "320bde47-d2ee-451b-a0ac-a71dd0b59864", 
    "call_request_tags": [
      "pulp:consumer:anna", 
      "pulp:action:unit_install"
    ], 
    "reasons": [], 
    "start_time": null, 
    "traceback": null, 
    "schedule_id": null, 
    "finish_time": null, 
    "state": "waiting", 
    "result": null, 
    "dependency_failures": {}, 
    "call_request_group_id": "7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4", 
    "progress": {}, 
    "principal_login": "admin", 
    "response": "accepted", 
    "tags": [
      "pulp:consumer:anna", 
      "pulp:action:unit_install"
    ]
  }
]
(202, [{u'task_group_id': u'7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4', u'call_request_id': u'1437f0be-4e7c-4a13-ac63-949fd02be28a', u'exception': None, u'_href': u'/pulp/api/v2/task_groups/7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4/', u'task_id': u'1437f0be-4e7c-4a13-ac63-949fd02be28a', u'call_request_tags': [u'pulp:consumer:alicia', u'pulp:action:unit_install'], u'reasons': [], u'start_time': None, u'traceback': None, u'schedule_id': None, u'finish_time': None, u'state': u'waiting', u'result': None, u'dependency_failures': {}, u'call_request_group_id': u'7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4', u'progress': {}, u'principal_login': u'admin', u'response': u'accepted', u'tags': [u'pulp:consumer:alicia', u'pulp:action:unit_install']}, {u'task_group_id': u'7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4', u'call_request_id': u'320bde47-d2ee-451b-a0ac-a71dd0b59864', u'exception': None, u'_href': u'/pulp/api/v2/task_groups/7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4/', u'task_id': u'320bde47-d2ee-451b-a0ac-a71dd0b59864', u'call_request_tags': [u'pulp:consumer:anna', u'pulp:action:unit_install'], u'reasons': [], u'start_time': None, u'traceback': None, u'schedule_id': None, u'finish_time': None, u'state': u'waiting', u'result': None, u'dependency_failures': {}, u'call_request_group_id': u'7c2cf4e0-46d8-42a9-a3fa-5ee2012baee4', u'progress': {}, u'principal_login': u'admin', u'response': u'accepted', u'tags': [u'pulp:consumer:anna', u'pulp:action:unit_install']}])
>>>

Comment 9 Preethi Thomas 2013-05-30 01:32:05 UTC
update

pic.POST('/v2/consumer_groups/consumer-grp/actions/content/update/',body={'units':[{'unit_key':{'name':'walrus'},'type_id':'rpm'}], 'options':{} })
Request Body
{
  "units": [
    {
      "unit_key": {
        "name": "walrus"
      }, 
      "type_id": "rpm"
    }
  ], 
  "options": {}
}
Response Body
[
  {
    "task_group_id": "a19376ab-7147-4b4d-8d40-88c6a38730f2", 
    "call_request_id": "8e43981b-92e8-4cef-b09d-f64116738285", 
    "exception": null, 
    "_href": "/pulp/api/v2/task_groups/a19376ab-7147-4b4d-8d40-88c6a38730f2/", 
    "task_id": "8e43981b-92e8-4cef-b09d-f64116738285", 
    "call_request_tags": [
      "pulp:consumer:anna", 
      "pulp:action:unit_update"
    ], 
    "reasons": [], 
    "start_time": null, 
    "traceback": null, 
    "schedule_id": null, 
    "finish_time": null, 
    "state": "waiting", 
    "result": null, 
    "dependency_failures": {}, 
    "call_request_group_id": "a19376ab-7147-4b4d-8d40-88c6a38730f2", 
    "progress": {}, 
    "principal_login": "admin", 
    "response": "accepted", 
    "tags": [
      "pulp:consumer:anna", 
      "pulp:action:unit_update"
    ]
  }, 
  {
    "task_group_id": "a19376ab-7147-4b4d-8d40-88c6a38730f2", 
    "call_request_id": "f965fe85-f38a-43e8-b8a7-972005ac7c0f", 
    "exception": null, 
    "_href": "/pulp/api/v2/task_groups/a19376ab-7147-4b4d-8d40-88c6a38730f2/", 
    "task_id": "f965fe85-f38a-43e8-b8a7-972005ac7c0f", 
    "call_request_tags": [
      "pulp:consumer:alicia", 
      "pulp:action:unit_update"
    ], 
    "reasons": [], 
    "start_time": null, 
    "traceback": null, 
    "schedule_id": null, 
    "finish_time": null, 
    "state": "waiting", 
    "result": null, 
    "dependency_failures": {}, 
    "call_request_group_id": "a19376ab-7147-4b4d-8d40-88c6a38730f2", 
    "progress": {}, 
    "principal_login": "admin", 
    "response": "accepted", 
    "tags": [
      "pulp:consumer:alicia", 
      "pulp:action:unit_update"
    ]
  }
]
(202, [{u'task_group_id': u'a19376ab-7147-4b4d-8d40-88c6a38730f2', u'call_request_id': u'8e43981b-92e8-4cef-b09d-f64116738285', u'exception': None, u'_href': u'/pulp/api/v2/task_groups/a19376ab-7147-4b4d-8d40-88c6a38730f2/', u'task_id': u'8e43981b-92e8-4cef-b09d-f64116738285', u'call_request_tags': [u'pulp:consumer:anna', u'pulp:action:unit_update'], u'reasons': [], u'start_time': None, u'traceback': None, u'schedule_id': None, u'finish_time': None, u'state': u'waiting', u'result': None, u'dependency_failures': {}, u'call_request_group_id': u'a19376ab-7147-4b4d-8d40-88c6a38730f2', u'progress': {}, u'principal_login': u'admin', u'response': u'accepted', u'tags': [u'pulp:consumer:anna', u'pulp:action:unit_update']}, {u'task_group_id': u'a19376ab-7147-4b4d-8d40-88c6a38730f2', u'call_request_id': u'f965fe85-f38a-43e8-b8a7-972005ac7c0f', u'exception': None, u'_href': u'/pulp/api/v2/task_groups/a19376ab-7147-4b4d-8d40-88c6a38730f2/', u'task_id': u'f965fe85-f38a-43e8-b8a7-972005ac7c0f', u'call_request_tags': [u'pulp:consumer:alicia', u'pulp:action:unit_update'], u'reasons': [], u'start_time': None, u'traceback': None, u'schedule_id': None, u'finish_time': None, u'state': u'waiting', u'result': None, u'dependency_failures': {}, u'call_request_group_id': u'a19376ab-7147-4b4d-8d40-88c6a38730f2', u'progress': {}, u'principal_login': u'admin', u'response': u'accepted', u'tags': [u'pulp:consumer:alicia', u'pulp:action:unit_update']}])
>>> 




[root@cloud-qe-1 ~]# rpm -q walrus
walrus-0.71-1.noarch
[root@cloud-qe-1 ~]# rpm -q walrus
walrus-5.21-1.noarch
[root@cloud-qe-1 ~]#

Comment 10 Preethi Thomas 2013-05-30 01:32:48 UTC
Uninstall

>>> pic.POST('/v2/consumer_groups/consumer-grp/actions/content/uninstall/',body={'units':[{'unit_key':{'name':'walrus'},'type_id':'rpm'}], 'options':{} })
Request Body
{
  "units": [
    {
      "unit_key": {
        "name": "walrus"
      }, 
      "type_id": "rpm"
    }
  ], 
  "options": {}
}
Response Body
[
  {
    "task_group_id": "fde8d79e-8ddb-4e1d-a50e-b279554e44c9", 
    "call_request_id": "ca6b8688-8c0f-4447-a5d1-6f51829c9dd2", 
    "exception": null, 
    "_href": "/pulp/api/v2/task_groups/fde8d79e-8ddb-4e1d-a50e-b279554e44c9/", 
    "task_id": "ca6b8688-8c0f-4447-a5d1-6f51829c9dd2", 
    "call_request_tags": [
      "pulp:consumer:anna", 
      "pulp:action:unit_uninstall"
    ], 
    "reasons": [], 
    "start_time": null, 
    "traceback": null, 
    "schedule_id": null, 
    "finish_time": null, 
    "state": "waiting", 
    "result": null, 
    "dependency_failures": {}, 
    "call_request_group_id": "fde8d79e-8ddb-4e1d-a50e-b279554e44c9", 
    "progress": {}, 
    "principal_login": "admin", 
    "response": "accepted", 
    "tags": [
      "pulp:consumer:anna", 
      "pulp:action:unit_uninstall"
    ]
  }, 
  {
    "task_group_id": "fde8d79e-8ddb-4e1d-a50e-b279554e44c9", 
    "call_request_id": "5a2506ba-db06-47c5-9132-15e41fa61038", 
    "exception": null, 
    "_href": "/pulp/api/v2/task_groups/fde8d79e-8ddb-4e1d-a50e-b279554e44c9/", 
    "task_id": "5a2506ba-db06-47c5-9132-15e41fa61038", 
    "call_request_tags": [
      "pulp:consumer:alicia", 
      "pulp:action:unit_uninstall"
    ], 
    "reasons": [], 
    "start_time": null, 
    "traceback": null, 
    "schedule_id": null, 
    "finish_time": null, 
    "state": "waiting", 
    "result": null, 
    "dependency_failures": {}, 
    "call_request_group_id": "fde8d79e-8ddb-4e1d-a50e-b279554e44c9", 
    "progress": {}, 
    "principal_login": "admin", 
    "response": "accepted", 
    "tags": [
      "pulp:consumer:alicia", 
      "pulp:action:unit_uninstall"
    ]
  }
]
(202, [{u'task_group_id': u'fde8d79e-8ddb-4e1d-a50e-b279554e44c9', u'call_request_id': u'ca6b8688-8c0f-4447-a5d1-6f51829c9dd2', u'exception': None, u'_href': u'/pulp/api/v2/task_groups/fde8d79e-8ddb-4e1d-a50e-b279554e44c9/', u'task_id': u'ca6b8688-8c0f-4447-a5d1-6f51829c9dd2', u'call_request_tags': [u'pulp:consumer:anna', u'pulp:action:unit_uninstall'], u'reasons': [], u'start_time': None, u'traceback': None, u'schedule_id': None, u'finish_time': None, u'state': u'waiting', u'result': None, u'dependency_failures': {}, u'call_request_group_id': u'fde8d79e-8ddb-4e1d-a50e-b279554e44c9', u'progress': {}, u'principal_login': u'admin', u'response': u'accepted', u'tags': [u'pulp:consumer:anna', u'pulp:action:unit_uninstall']}, {u'task_group_id': u'fde8d79e-8ddb-4e1d-a50e-b279554e44c9', u'call_request_id': u'5a2506ba-db06-47c5-9132-15e41fa61038', u'exception': None, u'_href': u'/pulp/api/v2/task_groups/fde8d79e-8ddb-4e1d-a50e-b279554e44c9/', u'task_id': u'5a2506ba-db06-47c5-9132-15e41fa61038', u'call_request_tags': [u'pulp:consumer:alicia', u'pulp:action:unit_uninstall'], u'reasons': [], u'start_time': None, u'traceback': None, u'schedule_id': None, u'finish_time': None, u'state': u'waiting', u'result': None, u'dependency_failures': {}, u'call_request_group_id': u'fde8d79e-8ddb-4e1d-a50e-b279554e44c9', u'progress': {}, u'principal_login': u'admin', u'response': u'accepted', u'tags': [u'pulp:consumer:alicia', u'pulp:action:unit_uninstall']}])
>>>

Comment 11 Preethi Thomas 2013-05-30 01:34:21 UTC
Comments above shows package install/update/uninstall on consumer group.

Moving the bug to verified

[root@ibm-x3550m3-09 ~]# rpm -q pulp-server
pulp-server-2.1.2-0.1.beta.el6.noarch
[root@ibm-x3550m3-09 ~]#

Comment 12 Preethi Thomas 2013-09-10 15:44:13 UTC
2.2 released
http://repos.fedorapeople.org/repos/pulp/pulp/stable/2.2/