← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1014689] Re: Create Volume snapshot force parameter is not validated

 

So yes the client should only do like:  "--force" which would set a real
boolean = True.

Breaking compat is an issue here though.

That being said, the issue of not handling garbage input is addressed in
the cinder API now via bool_from_str(), so that if garbage is passed in
it will give an Invalid parameter exception which is correct.  I have no
problem with doing a check earlier in the client (so long as it's the
same as what we implemented in the API [bool_from_str()]).

When we're ready to version bump again I would like to make the --force
arguments better but until then I think we need to leave it as is and
just fix the issues.  Marking as invalid for cinderclient for that
reason.

** Changed in: python-cinderclient
       Status: Triaged => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1014689

Title:
  Create Volume snapshot force parameter is not validated

Status in Cinder:
  Fix Released
Status in OpenStack Compute (Nova):
  Fix Released
Status in Python client library for Cinder:
  Invalid

Bug description:
  Description:

  Create Volume snapshot with invalid Force value is returning 200 ok
  instead of raising Bad Request.

  
  Expected Result:

  Should return error code 400. (raise Bad Request)

  Actual Result:

  Is not raising exception. Returning 200 ok.

  LOG:
  -------

  ----------------------------------------------------------------------

  rajalakshmi_ganesan@pshys0183~tests:-)>nova --debug volume-snapshot-create 22 --force '~!@#$%^&*()_+'
  connect: (10.233.53.165, 8774)
  send: 'GET /v1.1/ HTTP/1.1\r\nHost: 10.233.53.165:8774\r\nx-auth-project-id: admin\r\nx-auth-key: testuser\r\naccept-encoding: gzip, deflate\r\nx-auth-user: admin\r\nuser-agent: python-novaclient\r\n\r\n'
  reply: 'HTTP/1.1 204 No Content\r\n'
  header: Content-Length: 0
  header: X-Auth-Token: admin:admin
  header: X-Server-Management-Url: http://10.233.53.165:8774/v1.1/admin
  header: Content-Type: text/plain; charset=UTF-8
  header: Date: Mon, 18 Jun 2012 19:52:37 GMT
  send: 'POST /v1.1/admin/os-snapshots HTTP/1.1\r\nHost: 10.233.53.165:8774\r\nContent-Length: 108\r\nx-auth-project-id: admin\r\nx-auth-token: admin:admin\r\ncontent-type: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: python-novaclient\r\n\r\n{"snapshot": {"display_name": null, "force": "~!@#$%^&*()_+", "display_description": null, "volume_id": 22}}'
  reply: 'HTTP/1.1 200 OK\r\n'
  header: X-Compute-Request-Id: req-bc28a045-4308-4c65-819d-2870ebf45adc
  header: Content-Type: application/json
  header: Content-Length: 165
  header: Date: Mon, 18 Jun 2012 19:52:37 GMT
  rajalakshmi_ganesan@pshys0183~tests:-)>nova --debug volume-snapshot-create 22 --force 'alphabet1234567890-='
  connect: (10.233.53.165, 8774)
  send: 'GET /v1.1/ HTTP/1.1\r\nHost: 10.233.53.165:8774\r\nx-auth-project-id: admin\r\nx-auth-key: testuser\r\naccept-encoding: gzip, deflate\r\nx-auth-user: admin\r\nuser-agent: python-novaclient\r\n\r\n'
  reply: 'HTTP/1.1 204 No Content\r\n'
  header: Content-Length: 0
  header: X-Auth-Token: admin:admin
  header: X-Server-Management-Url: http://10.233.53.165:8774/v1.1/admin
  header: Content-Type: text/plain; charset=UTF-8
  header: Date: Mon, 18 Jun 2012 19:53:10 GMT
  send: 'POST /v1.1/admin/os-snapshots HTTP/1.1\r\nHost: 10.233.53.165:8774\r\nContent-Length: 115\r\nx-auth-project-id: admin\r\nx-auth-token: admin:admin\r\ncontent-type: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: python-novaclient\r\n\r\n{"snapshot": {"display_name": null, "force": "alphabet1234567890-=", "display_description": null, "volume_id": 22}}'
  reply: 'HTTP/1.1 200 OK\r\n'
  header: X-Compute-Request-Id: req-a004c5de-c53f-4155-8a9e-ebeab21fa63a
  header: Content-Type: application/json
  header: Content-Length: 165
  header: Date: Mon, 18 Jun 2012 19:53:10 GMT

  rajalakshmi_ganesan@pshys0183~tests:-( >nova --debug volume-snapshot-create 22 --force ''
  connect: (10.233.53.165, 8774)
  send: 'GET /v1.1/ HTTP/1.1\r\nHost: 10.233.53.165:8774\r\nx-auth-project-id: admin\r\nx-auth-key: testuser\r\naccept-encoding: gzip, deflate\r\nx-auth-user: admin\r\nuser-agent: python-novaclient\r\n\r\n'
  reply: 'HTTP/1.1 204 No Content\r\n'
  header: Content-Length: 0
  header: X-Auth-Token: admin:admin
  header: X-Server-Management-Url: http://10.233.53.165:8774/v1.1/admin
  header: Content-Type: text/plain; charset=UTF-8
  header: Date: Mon, 18 Jun 2012 19:55:15 GMT
  send: 'POST /v1.1/admin/os-snapshots HTTP/1.1\r\nHost: 10.233.53.165:8774\r\nContent-Length: 95\r\nx-auth-project-id: admin\r\nx-auth-token: admin:admin\r\ncontent-type: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: python-novaclient\r\n\r\n{"snapshot": {"display_name": null, "force": "", "display_description": null, "volume_id": 22}}'
  reply: 'HTTP/1.1 200 OK\r\n'
  header: X-Compute-Request-Id: req-b4b202e4-c15a-40be-bfc7-efec2fd2c4c6
  header: Content-Type: application/json
  header: Content-Length: 165
  header: Date: Mon, 18 Jun 2012 19:55:15 GMT

To manage notifications about this bug go to:
https://bugs.launchpad.net/cinder/+bug/1014689/+subscriptions