Project

Profile

Help

Issue #320

Content manipulation on consumer raises a traceback instead of 202

Added by ipanova@redhat.com over 6 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Platform Release:
2.7.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d '{"units":[{"unit_key": {"name": "zsh", "version": "4.3.17"}, "type_id": "rpm"}], "options":{"apply": false, "reboot": false, "importkeys": false}}' "https://localhost/pulp/api/v2/consumers/c1/actions/content/install/"
HTTP/1.1 500 Internal Server Error
Date: Thu, 26 Feb 2015 10:58:27 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 5026
Connection: close
Content-Type: application/json

{"http_request_method": "POST", "exception": ["AttributeError: 'TaskStatus' object has no attribute 'get'\n"], "error_message": "'TaskStatus' object has no attribute 'get'", "_href": "/pulp/api/v2/consumers/c1/actions/content/install/", "http_status": 500, "traceback": [" File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/middleware/exception.py\", line 46, in call\n return self.app(environ, start_response)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/middleware/postponed.py\", line 55, in call\n return self.app(environ, start_response)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 279, in wsgi\n result = self.handle_with_processors()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 18, in _handle_with_processors\n return process(self.processors)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 566, in processor\n return handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 581, in processor\n result = handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 17, in process\n return self.handle()\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 230, in handle\n return self._delegate(fn, self.fvars, args)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 422, in _delegate\n return f()\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 430, in <lambda>\n f = lambda: self._delegate_sub_application(pat, what)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 455, in _delegate_sub_application\n return app.handle_with_processors()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 18, in _handle_with_processors\n return process(self.processors)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 566, in processor\n return handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 581, in processor\n result = handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 17, in process\n return self.handle()\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 230, in handle\n return self._delegate(fn, self.fvars, args)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 405, in _delegate\n return handle_class(f)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 396, in handle_class\n return tocall(*args)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/decorators.py\", line 241, in _auth_decorator\n return _verify_auth(self, operation, super_user_only, method, *args, **kwargs)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/decorators.py\", line 195, in _verify_auth\n value = method(self, *args, **kwargs)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/consumers.py\", line 308, in POST\n return method(consumer_id)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/consumers.py\", line 335, in install\n raise OperationPostponed(TaskResult.from_task_status_dict(task))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/async/tasks.py\", line 201, in from_task_status_dict\n return cls(spawned_tasks=[{'task_id': task_status.get('task_id')}])\n"]}

History

#1 Updated by ipanova@redhat.com over 6 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ipanova@redhat.com

#2 Updated by bmbouter over 6 years ago

  • Triaged changed from No to Yes
  • Severity set to Low

#3 Updated by ipanova@redhat.com over 6 years ago

  • Status changed from ASSIGNED to POST

#4 Updated by bmbouter over 6 years ago

  • Severity changed from Low to 1. Low

#5 Updated by ipanova@redhat.com over 6 years ago

  • Status changed from POST to MODIFIED

#6 Updated by dkliban@redhat.com over 6 years ago

  • Platform Release set to 2.7.0

#7 Updated by dkliban@redhat.com over 6 years ago

  • Status changed from MODIFIED to 5

#8 Updated by igulina@redhat.com over 6 years ago

  • Status changed from 5 to 6
>> rpm -qa pulp-server
pulp-server-2.7.0-0.4.beta.el7.noarch

>> curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d '{"units":[{"unit_key": {"name": "zsh", "version": "4.3.17"}, "type_id": "rpm"}], "options":{"apply": false, "reboot": false, "importkeys": false}}' "https://localhost/pulp/api/v2/consumers/makaka/actions/content/install/" 
HTTP/1.1 202 ACCEPTED
Date: Fri, 03 Jul 2015 13:50:34 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 172
Content-Type: application/json

{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/662666e1-4750-43f6-af1c-c517283999d2/", "task_id": "662666e1-4750-43f6-af1c-c517283999d2"}], "result": null, "error": null}

#9 Updated by amacdona@redhat.com almost 6 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#11 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

#12 Updated by bmbouter over 1 year ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Please register to edit this issue

Also available in: Atom PDF