Project

Profile

Help

Issue #824

Retrieve binding by consumer and repository url should accept only GET

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

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Quarter:

Description

this issue was initially present in webpy, during the django conversion we decided to solve this issue separately(so it is present in django also).

http://pulp.readthedocs.org/en/latest/dev-guide/integration/rest-api/consumer/bind.html#retrieve-binding-by-consumer-and-repository

$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d {} "https://localhost/pulp/api/v2/consumers/1234/bindings/zoo1/"
HTTP/1.1 500 Internal Server Error
Date: Mon, 30 Mar 2015 11:37:47 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: 4459
Connection: close
Content-Type: application/json

{"http_request_method": "POST", "exception": ["TypeError: POST() takes exactly 2 arguments (3 given)\n"], "error_message": "POST() takes exactly 2 arguments (3 given)", "_href": "/pulp/api/v2/consumers/1234/bindings/zoo1/", "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"]}[ipanova@ina pulp]$
[ipanova@ina pulp]$
[ipanova@ina pulp]$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X PUT -k -u admin:admin -d {} "https://localhost/pulp/api/v2/consumers/1234/bindings/zoo1/"
HTTP/1.1 405 Method Not Allowed
Date: Mon, 30 Mar 2015 11:37:55 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Allow: GET, POST
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

None

$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: django" -X POST -k -u admin:admin -d {} "https://localhost/pulp/api/v2/consumers/1234/bindings/zoo1/"
HTTP/1.1 500 INTERNAL SERVER ERROR
Date: Mon, 30 Mar 2015 15:43:33 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: 1306
Connection: close
Content-Type: application/json

{"http_request_method": "POST", "exception": ["TypeError: post() got an unexpected keyword argument 'repo_id'\n"], "error_message": "post() got an unexpected keyword argument 'repo_id'", "_href": "/pulp/api/v2/consumers/1234/bindings/zoo1/", "http_status": 500, "traceback": [" File \"/usr/lib/python2.7/site-packages/django/core/handlers/base.py\", line 112, in get_response\n response = wrapped_callback(request, *callback_args, **callback_kwargs)\n", " File \"/usr/lib/python2.7/site-packages/django/views/generic/base.py\", line 69, in view\n return self.dispatch(request, *args, **kwargs)\n", " File \"/usr/lib/python2.7/site-packages/django/views/generic/base.py\", line 87, in dispatch\n return handler(request, *args, **kwargs)\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/views/util.py\", line 90, in wrapper\n return func(*args, **kwargs)\n"]}

Associated revisions

Revision d7201019 View on GitHub
Added by ttereshc over 5 years ago

824 - Retrieve binding by consumer and repository url should accept only GET

closes #824 https://pulp.plan.io/issues/824

Revision d7201019 View on GitHub
Added by ttereshc over 5 years ago

824 - Retrieve binding by consumer and repository url should accept only GET

closes #824 https://pulp.plan.io/issues/824

History

#1 Updated by mhrivnak over 6 years ago

  • Triaged changed from No to Yes
  • Tags Easy Fix added

#2 Updated by ttereshc over 5 years ago

  • Assignee set to ttereshc

#3 Updated by ttereshc over 5 years ago

  • Status changed from NEW to ASSIGNED

#4 Updated by ttereshc over 5 years ago

  • Status changed from ASSIGNED to POST

#5 Updated by ttereshc over 5 years ago

  • Platform Release set to 2.8.0

#6 Updated by ttereshc over 5 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

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

  • Status changed from MODIFIED to 5

#8 Updated by dkliban@redhat.com over 5 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#9 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF