This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 878234 - Consumer group package_install , update and uninstall not returning correct result
Consumer group package_install , update and uninstall not returning correct ...
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: consumers (Show other bugs)
Master
Unspecified Unspecified
high Severity high
: ---
: 2.1.2
Assigned To: Jeff Ortel
Preethi Thomas
: Triaged
Depends On:
Blocks: katello-v2-pulp
  Show dependency treegraph
 
Reported: 2012-11-19 17:04 EST by Partha Aji
Modified: 2013-09-10 11:44 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-10 11:44:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Partha Aji 2012-11-19 17:04:33 EST
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 04:56:38 EST
Added functionality to record and return a list of install call requests.
Comment 2 Sayli Karmarkar 2013-02-05 04:08:44 EST
Merged pull request. Moving to modified. 

commit 198860b602099adf553e745cd11dccf28ee5573b
Merge: 373ee00 d1c0562
Author: skarmark <skarmark@redhat.com>
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 15:56:59 EST
build: 2.1.0-0.3.alpha
Comment 4 Sayli Karmarkar 2013-04-04 15:29:50 EDT
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 15:06:44 EDT
https://github.com/pulp/pulp/pull/498
Comment 6 Jeff Ortel 2013-05-29 13:45:13 EDT
build: 2.1.2-0.1.beta
Comment 7 Preethi Thomas 2013-05-29 20:50:35 EDT
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-29 21:29:35 EDT
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-29 21:32:05 EDT
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-29 21:32:48 EDT
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-29 21:34:21 EDT
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 11:44:13 EDT
2.2 released
http://repos.fedorapeople.org/repos/pulp/pulp/stable/2.2/

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