<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/python-cinderclient.git/cinderclient/shell.py, branch 1.11.0</title>
<subtitle>opendev.org: openstack/python-cinderclient.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-cinderclient.git/'/>
<entry>
<title>Python3 common patterns</title>
<updated>2017-01-10T08:55:30+00:00</updated>
<author>
<name>xianming mao</name>
<email>xianming.mao@easystack.cn</email>
</author>
<published>2016-12-21T05:58:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-cinderclient.git/commit/?id=44507540f6904e2ae5bba8283723de2f6748810b'/>
<id>44507540f6904e2ae5bba8283723de2f6748810b</id>
<content type='text'>
Modify some codes in order to lead them meet the python3 common pattern.
Look through the following patterns of Cinder,
      map() and filter() if a list is needed on Python 3:
          Replace map(func, data) with [func(item) for item in data]
          Replace filter(lambda obj: test(obj), data) with
             [obj for obj in data if test(obj)]
      Replace exceptions.OSError with OSError and
         remove "import exceptions"
      Replace iterator.next() with next(iterator)
      Replace basestring with six.string_types
      Replace unicode with six.text_type
      Replace (str, unicode) with six.string_types
      Replace "for key in dict.iterkeys()" with "for key in dict"
      Replace dict.iteritems() with dict.items()
      Replace dict.itervalues() with dict.values()
I found that only "filter(lambda obj: test(obj), data)" and
"map(func, data)"need to modify.
The other items are not be founded in Cinder.

Reference:https://wiki.openstack.org/wiki/Python3#Common_patterns

Change-Id: If33ec39eb176c14086132d3099c6ec577f956ded
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modify some codes in order to lead them meet the python3 common pattern.
Look through the following patterns of Cinder,
      map() and filter() if a list is needed on Python 3:
          Replace map(func, data) with [func(item) for item in data]
          Replace filter(lambda obj: test(obj), data) with
             [obj for obj in data if test(obj)]
      Replace exceptions.OSError with OSError and
         remove "import exceptions"
      Replace iterator.next() with next(iterator)
      Replace basestring with six.string_types
      Replace unicode with six.text_type
      Replace (str, unicode) with six.string_types
      Replace "for key in dict.iterkeys()" with "for key in dict"
      Replace dict.iteritems() with dict.items()
      Replace dict.itervalues() with dict.values()
I found that only "filter(lambda obj: test(obj), data)" and
"map(func, data)"need to modify.
The other items are not be founded in Cinder.

Reference:https://wiki.openstack.org/wiki/Python3#Common_patterns

Change-Id: If33ec39eb176c14086132d3099c6ec577f956ded
</pre>
</div>
</content>
</entry>
<entry>
<title>Move trace ID print statement to finally</title>
<updated>2016-11-18T09:25:06+00:00</updated>
<author>
<name>Vipin Balachandran</name>
<email>vbala@vmware.com</email>
</author>
<published>2016-11-18T09:20:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-cinderclient.git/commit/?id=81a1487d91918575262a7534a636e602c2d3d274'/>
<id>81a1487d91918575262a7534a636e602c2d3d274</id>
<content type='text'>
If there is an exception raised by cinder-api while using
--profile option, the trace ID is not printed. Moving the
trace ID print statement to finally block to fix this.

Change-Id: I03df8cd47185d148051d66396f6cd8118efff73c
Closes-bug: #1642888
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If there is an exception raised by cinder-api while using
--profile option, the trace ID is not printed. Moving the
trace ID print statement to finally block to fix this.

Change-Id: I03df8cd47185d148051d66396f6cd8118efff73c
Closes-bug: #1642888
</pre>
</div>
</content>
</entry>
<entry>
<title>Update --endpoint-type dest to os_endpoint_type</title>
<updated>2016-10-21T22:07:51+00:00</updated>
<author>
<name>Nate Potter</name>
<email>nathaniel.potter@intel.com</email>
</author>
<published>2016-08-05T18:33:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-cinderclient.git/commit/?id=a33d87fb424455f05d6713993c9254c20f8f96a4'/>
<id>a33d87fb424455f05d6713993c9254c20f8f96a4</id>
<content type='text'>
Currently the dest of the deprecated --endpoint-type arg
is 'endpoint_type'. However, the code only uses 'os_endpoint_type'
so right now it isn't being used at all. This patch updates
the dest to be 'os_endpoint_type' so that the variable can
be assigned correctly.

Change-Id: Ie8592d12bcf95e4ccff571e831440b18f5acfd40
Closes-bug: #1454436
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the dest of the deprecated --endpoint-type arg
is 'endpoint_type'. However, the code only uses 'os_endpoint_type'
so right now it isn't being used at all. This patch updates
the dest to be 'os_endpoint_type' so that the variable can
be assigned correctly.

Change-Id: Ie8592d12bcf95e4ccff571e831440b18f5acfd40
Closes-bug: #1454436
</pre>
</div>
</content>
</entry>
<entry>
<title>Help msg and output info should support il8n.</title>
<updated>2016-10-18T12:12:25+00:00</updated>
<author>
<name>xianming mao</name>
<email>xianming.mao@easystack.cn</email>
</author>
<published>2016-09-07T08:42:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-cinderclient.git/commit/?id=41a418706199e406024b1736dc48f9e87efd9778'/>
<id>41a418706199e406024b1736dc48f9e87efd9778</id>
<content type='text'>
Help msg and output info should support il8n.
And delete the unused import six.

Close-Bug: #1629157
Change-Id: Ie1faf0a83ec5f04dc6c8303f1ea0c931ba482e2a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Help msg and output info should support il8n.
And delete the unused import six.

Close-Bug: #1629157
Change-Id: Ie1faf0a83ec5f04dc6c8303f1ea0c931ba482e2a
</pre>
</div>
</content>
</entry>
<entry>
<title>Print backtrace for exception when in debug mode</title>
<updated>2016-10-11T15:17:26+00:00</updated>
<author>
<name>Eric Harney</name>
<email>eharney@redhat.com</email>
</author>
<published>2016-10-06T20:33:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-cinderclient.git/commit/?id=268f50270da55bf29a2d10ae442d58aee2a8ba53'/>
<id>268f50270da55bf29a2d10ae442d58aee2a8ba53</id>
<content type='text'>
If the cinder shell is run in debug mode
(CINDERCLIENT_DEBUG is set in the environment or
with --debug), print a traceback for unhandled
exceptions.

This makes it possible to debug issues like this:
  $ cinder credentials
  ERROR: list indices must be integers, not str

Related-Bug: #1631142

Co-Authored-By: Gorka Eguileor &lt;geguileo@redhat.com&gt;
Change-Id: I5e9b3283602d404ab43494f15d57ec5abbcd77dc
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the cinder shell is run in debug mode
(CINDERCLIENT_DEBUG is set in the environment or
with --debug), print a traceback for unhandled
exceptions.

This makes it possible to debug issues like this:
  $ cinder credentials
  ERROR: list indices must be integers, not str

Related-Bug: #1631142

Co-Authored-By: Gorka Eguileor &lt;geguileo@redhat.com&gt;
Change-Id: I5e9b3283602d404ab43494f15d57ec5abbcd77dc
</pre>
</div>
</content>
</entry>
<entry>
<title>Removed multiple import from shell.py</title>
<updated>2016-09-20T11:30:20+00:00</updated>
<author>
<name>Gábor Antal</name>
<email>antal@inf.u-szeged.hu</email>
</author>
<published>2016-09-19T16:13:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-cinderclient.git/commit/?id=aa1c3e82dd6c116fbc4ccf34e919798895cc679a'/>
<id>aa1c3e82dd6c116fbc4ccf34e919798895cc679a</id>
<content type='text'>
In shell.py, six is imported twice.
In this patchset, one of them is removed.

TrivialFix

Change-Id: Ifbf6dcb20d5de54855aab53538b57eb11185ab2b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In shell.py, six is imported twice.
In this patchset, one of them is removed.

TrivialFix

Change-Id: Ifbf6dcb20d5de54855aab53538b57eb11185ab2b
</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://git.baserock.org/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://git.baserock.org/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>Use 'six' instead of oslo_utils.strutils.six</title>
<updated>2016-08-08T09:22:29+00:00</updated>
<author>
<name>dineshbhor</name>
<email>dinesh.bhor@nttdata.com</email>
</author>
<published>2016-08-05T11:53:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-cinderclient.git/commit/?id=a635fd21999a3886987043b7e9890d5d84f3c6ac'/>
<id>a635fd21999a3886987043b7e9890d5d84f3c6ac</id>
<content type='text'>
'six' is an independent third party module so it doesn't
need to be imported and used from oslo_utils.strutils.

TrivialFix

Change-Id: Icb3232bb1ebae0e8332e66c5806474d7f9dfd6df
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'six' is an independent third party module so it doesn't
need to be imported and used from oslo_utils.strutils.

TrivialFix

Change-Id: Icb3232bb1ebae0e8332e66c5806474d7f9dfd6df
</pre>
</div>
</content>
</entry>
<entry>
<title>Use self.ks_logger instead of ks_logger</title>
<updated>2016-08-01T05:41:47+00:00</updated>
<author>
<name>dineshbhor</name>
<email>dinesh.bhor@nttdata.com</email>
</author>
<published>2016-07-27T07:28:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-cinderclient.git/commit/?id=29028b86b947edcf5ff43cc56ee2287be29a389c'/>
<id>29028b86b947edcf5ff43cc56ee2287be29a389c</id>
<content type='text'>
Currently with '--debug' option any cinder command only logs the
request from keystoneauth and not the main cinder service request.

Added keystoneauth logger to self.ks_logger so that logs can be
logged as expected.

Closes-Bug: #1606814

Change-Id: I7193aa6f43cb3186c49fc409b6e1ce7a36f596f9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently with '--debug' option any cinder command only logs the
request from keystoneauth and not the main cinder service request.

Added keystoneauth logger to self.ks_logger so that logs can be
logged as expected.

Closes-Bug: #1606814

Change-Id: I7193aa6f43cb3186c49fc409b6e1ce7a36f596f9
</pre>
</div>
</content>
</entry>
</feed>
