<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/python-cinderclient.git/cinderclient/exceptions.py, branch 3.5.0</title>
<subtitle>opendev.org: openstack/python-cinderclient.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/'/>
<entry>
<title>Add cinder create --poll</title>
<updated>2017-07-24T13:06:28+00:00</updated>
<author>
<name>Chaynika Saikia</name>
<email>csaikia@asu.edu</email>
</author>
<published>2017-06-19T20:27:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/commit/?id=0cb09cc560436538366cfa4c91136ba5538f5167'/>
<id>0cb09cc560436538366cfa4c91136ba5538f5167</id>
<content type='text'>
Usage: It adds an optional argument --poll to the cinder
create command which waits while the creation of the volume
is completed and the volume goes to available state. In case
there is an error in volume creation, it throws an error message
and exits with a non zero status. The error message printed here
is the async error message in case it generates one.

Depends-On: Ic3ab32b95abd29e995bc071adc11b1e481b32516

Change-Id: I1a4d361d48a44a0daa830491f415be64f2e356e3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Usage: It adds an optional argument --poll to the cinder
create command which waits while the creation of the volume
is completed and the volume goes to available state. In case
there is an error in volume creation, it throws an error message
and exits with a non zero status. The error message printed here
is the async error message in case it generates one.

Depends-On: Ic3ab32b95abd29e995bc071adc11b1e481b32516

Change-Id: I1a4d361d48a44a0daa830491f415be64f2e356e3
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle error response for webob&gt;=1.6.0</title>
<updated>2016-12-09T11:21:16+00:00</updated>
<author>
<name>Akira KAMIO</name>
<email>akamio@yahoo-corp.jp</email>
</author>
<published>2016-12-06T05:10:38+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/commit/?id=19befa69651a41534c7d25b1a0d3a0cd407afb44'/>
<id>19befa69651a41534c7d25b1a0d3a0cd407afb44</id>
<content type='text'>
WebOb change https://github.com/Pylons/webob/pull/230 changed
the way in which the error response body is formatted such that
it's no longer a nested dict. So we have to handle both the
old convention of an error message key to the response body error
dict and the new way with just the error body dict.

This was reported upstream:

https://github.com/Pylons/webob/issues/235

But given this was apparently implemented as a long-overdue change
in WebOb the behavior is not likely to change.Handle error response for
webob&gt;=1.6.0

Change-Id: I7d589415aa024588faf77c8234ac026110f6c3cd
Closes-Bug: #1559072
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
WebOb change https://github.com/Pylons/webob/pull/230 changed
the way in which the error response body is formatted such that
it's no longer a nested dict. So we have to handle both the
old convention of an error message key to the response body error
dict and the new way with just the error body dict.

This was reported upstream:

https://github.com/Pylons/webob/issues/235

But given this was apparently implemented as a long-overdue change
in WebOb the behavior is not likely to change.Handle error response for
webob&gt;=1.6.0

Change-Id: I7d589415aa024588faf77c8234ac026110f6c3cd
Closes-Bug: #1559072
</pre>
</div>
</content>
</entry>
<entry>
<title>Make APIVersion's null check more pythonic</title>
<updated>2016-08-29T09:41:57+00:00</updated>
<author>
<name>Gorka Eguileor</name>
<email>geguileo@redhat.com</email>
</author>
<published>2016-08-05T12:45:28+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/commit/?id=8b5a772e36fb7b7fae42a956bc844e792bec2035'/>
<id>8b5a772e36fb7b7fae42a956bc844e792bec2035</id>
<content type='text'>
Our current APIVersion object has an is_null method to check when the
version instance is null (major=0 and minor=0).

While this works it is not very pythonic, since you have to write
expressions such as:

 if not min_version and not max_version:
     return True
 elif ((min_version and max_version) and
       max_version.is_null() and min_version.is_null()):
     return True

This patch removes the is_null method and instead implements the truth
value testing to simplify expressions and make code more pythonic.

So previous code would just look like:

 if not min_version and not max_version:
     return True

Because this will work with min_version being None or being an
APIVersion instance with major=0 and minor=0.

Change-Id: I7497c5dc940c1e726507117cadbad232d8c1d80d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Our current APIVersion object has an is_null method to check when the
version instance is null (major=0 and minor=0).

While this works it is not very pythonic, since you have to write
expressions such as:

 if not min_version and not max_version:
     return True
 elif ((min_version and max_version) and
       max_version.is_null() and min_version.is_null()):
     return True

This patch removes the is_null method and instead implements the truth
value testing to simplify expressions and make code more pythonic.

So previous code would just look like:

 if not min_version and not max_version:
     return True

Because this will work with min_version being None or being an
APIVersion instance with major=0 and minor=0.

Change-Id: I7497c5dc940c1e726507117cadbad232d8c1d80d
</pre>
</div>
</content>
</entry>
<entry>
<title>Add "start_version" and "end_version" support to  argparse</title>
<updated>2016-08-16T16:16:13+00:00</updated>
<author>
<name>Cao Shufeng</name>
<email>caosf.fnst@cn.fujitsu.com</email>
</author>
<published>2016-07-10T11:08:06+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/commit/?id=b76f5944130e29ee1bf3095c966a393c489c05e6'/>
<id>b76f5944130e29ee1bf3095c966a393c489c05e6</id>
<content type='text'>
Now, "cinder help subcommand" can not show whether an argument
is supported for a specific microversion.
With this change, developers only need to add a start_version or
end_version in the utils.arg wrap, cinderclient will support
the microversion for that arguement.

    @utils.arg(
    '--foo',
    start_version='3.1')
    @utils.arg(
    '--bar',
    start_version='3.2',
    end_version='3.5')
    def do_some_action():
        ......

In previous example, an exception will be raised for such command:
   $ cinder --os-volume-api-version 3.6 --bar some-ation

And only "--foo" will show up for such help command:
   $ cinder --os-volume-api-version 3.1 help some-ation

Change-Id: I74137486992846bbf9fdff53c009851db2356eef
Partial-Bug: #1600567
Co-Authored-By: Nate Potter &lt;nathaniel.potter@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now, "cinder help subcommand" can not show whether an argument
is supported for a specific microversion.
With this change, developers only need to add a start_version or
end_version in the utils.arg wrap, cinderclient will support
the microversion for that arguement.

    @utils.arg(
    '--foo',
    start_version='3.1')
    @utils.arg(
    '--bar',
    start_version='3.2',
    end_version='3.5')
    def do_some_action():
        ......

In previous example, an exception will be raised for such command:
   $ cinder --os-volume-api-version 3.6 --bar some-ation

And only "--foo" will show up for such help command:
   $ cinder --os-volume-api-version 3.1 help some-ation

Change-Id: I74137486992846bbf9fdff53c009851db2356eef
Partial-Bug: #1600567
Co-Authored-By: Nate Potter &lt;nathaniel.potter@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix _get_rate_limit when resp is None</title>
<updated>2016-07-06T16:42:30+00:00</updated>
<author>
<name>Javier Pena</name>
<email>jpena@redhat.com</email>
</author>
<published>2016-07-06T14:06:28+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/commit/?id=ebe02fb877a09d25d9dbb198934fd74eb0a455d6'/>
<id>ebe02fb877a09d25d9dbb198934fd74eb0a455d6</id>
<content type='text'>
https://review.openstack.org/332848 added retry logic for the client.
Function _get_rate_limit may receive resp=None (seen in the Sahara
unit tests), and in that case we get an exception.

Change-Id: Ibfbb10087121bae7d6f4abdd4cdb8d04d039c970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://review.openstack.org/332848 added retry logic for the client.
Function _get_rate_limit may receive resp=None (seen in the Sahara
unit tests), and in that case we get an exception.

Change-Id: Ibfbb10087121bae7d6f4abdd4cdb8d04d039c970
</pre>
</div>
</content>
</entry>
<entry>
<title>Cinder client should retry with Retry-After value</title>
<updated>2016-07-06T08:42:20+00:00</updated>
<author>
<name>Yuriy Nesenenko</name>
<email>ynesenenko@mirantis.com</email>
</author>
<published>2016-06-22T14:36:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/commit/?id=f8eef18297ec2dba4abf45f8ca57c40c2380cad9'/>
<id>f8eef18297ec2dba4abf45f8ca57c40c2380cad9</id>
<content type='text'>
If a request fails but the response contains a "Retry-After",
the cinder client should wait the amount of time and then retry.
Cinder client should report a warning to user and continue with
retry, so that user can cancel the operation if not interested
in retry. The value in "Retry-After" header will be in seconds
or GMT value, client should handle both the cases.

How many times client should retry will be controlled by user
through "--retries" argument to cinder api example,
$ cinder --retries 3 availability-zone-list

If request was not sucessful within the retries, client should
raise the exception.

Change-Id: I99af957bfbbe3a202b148dc2fcafdd20b5d7cda0
Partial-Bug: #1263069
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a request fails but the response contains a "Retry-After",
the cinder client should wait the amount of time and then retry.
Cinder client should report a warning to user and continue with
retry, so that user can cancel the operation if not interested
in retry. The value in "Retry-After" header will be in seconds
or GMT value, client should handle both the cases.

How many times client should retry will be controlled by user
through "--retries" argument to cinder api example,
$ cinder --retries 3 availability-zone-list

If request was not sucessful within the retries, client should
raise the exception.

Change-Id: I99af957bfbbe3a202b148dc2fcafdd20b5d7cda0
Partial-Bug: #1263069
</pre>
</div>
</content>
</entry>
<entry>
<title>Support api-microversions</title>
<updated>2016-04-19T17:19:45+00:00</updated>
<author>
<name>scottda</name>
<email>scott.dangelo@hpe.com</email>
</author>
<published>2016-04-05T21:45:28+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/commit/?id=3f75b48f067abae846655e48ce8f96fda79a3ae8'/>
<id>3f75b48f067abae846655e48ce8f96fda79a3ae8</id>
<content type='text'>
Changes to cinderclient to use microversions.

Implements: blueprint api-microversion-support-for-cinderclient
api-microversion-support-for-cinderclient

Change-Id: I840a1162b88e8ff36fa3fc4e1d6b9317104df3e0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Changes to cinderclient to use microversions.

Implements: blueprint api-microversion-support-for-cinderclient
api-microversion-support-for-cinderclient

Change-Id: I840a1162b88e8ff36fa3fc4e1d6b9317104df3e0
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't print HTTP codes for non-HTTP errors</title>
<updated>2016-02-24T16:00:05+00:00</updated>
<author>
<name>Eric Harney</name>
<email>eharney@redhat.com</email>
</author>
<published>2016-02-23T22:55:08+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/commit/?id=c4c2c56042e7829aa9ee0c4b7fad93d039fb4841'/>
<id>c4c2c56042e7829aa9ee0c4b7fad93d039fb4841</id>
<content type='text'>
This changes:
 $ cinder rename asdf
 ERROR: Must supply either name or description. (HTTP 1)

To:
 $ cinder rename asdf
 ERROR: Must supply either name or description.

Affects rename, snapshot-rename, consisgroup-update,
and consisgroup-create-from-src.
(consisgroup-* previously printed HTTP 400.)

Closes-Bug: #1549020
Closes-Bug: #1549026
Change-Id: Ia920b3b75b53170789b694cbdd49100bd6a72d21
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This changes:
 $ cinder rename asdf
 ERROR: Must supply either name or description. (HTTP 1)

To:
 $ cinder rename asdf
 ERROR: Must supply either name or description.

Affects rename, snapshot-rename, consisgroup-update,
and consisgroup-create-from-src.
(consisgroup-* previously printed HTTP 400.)

Closes-Bug: #1549020
Closes-Bug: #1549026
Change-Id: Ia920b3b75b53170789b694cbdd49100bd6a72d21
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix ClientException init when there is no message on py34</title>
<updated>2015-08-04T21:21:52+00:00</updated>
<author>
<name>Matt Riedemann</name>
<email>mriedem@us.ibm.com</email>
</author>
<published>2015-08-04T21:20:53+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/commit/?id=03542ee65a5e818a5d908a85a6a9eba21ef63b53'/>
<id>03542ee65a5e818a5d908a85a6a9eba21ef63b53</id>
<content type='text'>
BaseException.message was removed in python 3 per PEP 0352 so if no
message is passed to the ClientException __init__ it will blow up:

AttributeError: type object 'ClientException' has no attribute 'message'

So this change does two things:

1. Default to 'n/a' for message and details when body['keys'] doesn't
   have a message or details in it (which should be fine since
   from_response defaults to n/a if 'keys' is not in body).
2. Use getattr for self.__class__.message and default to None if that
   attribute is not set.  Arguably we could just remove this and make
   the message kwarg default to 'n/a' in ClientException.__init__ but
   I figured that was more invasive.

Closes-Bug: #1481478

Change-Id: I738cb9c8d4f015048c45a1df16bf18e29190e392
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BaseException.message was removed in python 3 per PEP 0352 so if no
message is passed to the ClientException __init__ it will blow up:

AttributeError: type object 'ClientException' has no attribute 'message'

So this change does two things:

1. Default to 'n/a' for message and details when body['keys'] doesn't
   have a message or details in it (which should be fine since
   from_response defaults to n/a if 'keys' is not in body).
2. Use getattr for self.__class__.message and default to None if that
   attribute is not set.  Arguably we could just remove this and make
   the message kwarg default to 'n/a' in ClientException.__init__ but
   I figured that was more invasive.

Closes-Bug: #1481478

Change-Id: I738cb9c8d4f015048c45a1df16bf18e29190e392
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typo in comment message</title>
<updated>2015-07-02T07:51:59+00:00</updated>
<author>
<name>Lin Yang</name>
<email>lin.a.yang@intel.com</email>
</author>
<published>2015-04-30T10:28:21+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-cinderclient.git/commit/?id=56778a1220eb1e15e1edea3e0ffed57e8bdd0fb4'/>
<id>56778a1220eb1e15e1edea3e0ffed57e8bdd0fb4</id>
<content type='text'>
an request =&gt; a request
rest =&gt; resp
exception_from_response() =&gt; exceptions.from_response() '.' operator means call
from_response() in exceptions module.

Change-Id: I5e780dd2882b39d1b39f7c64bf274e90934c09ec
Signed-off-by: Lin Yang &lt;lin.a.yang@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
an request =&gt; a request
rest =&gt; resp
exception_from_response() =&gt; exceptions.from_response() '.' operator means call
from_response() in exceptions module.

Change-Id: I5e780dd2882b39d1b39f7c64bf274e90934c09ec
Signed-off-by: Lin Yang &lt;lin.a.yang@intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
