<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/python-glanceclient.git/glanceclient/tests/unit/test_shell.py, branch 1.1.1</title>
<subtitle>opendev.org: openstack/python-glanceclient.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/'/>
<entry>
<title>Use session when not specified token or endpoint</title>
<updated>2016-03-09T13:47:56+00:00</updated>
<author>
<name>Darja Shakhray</name>
<email>dshakhray@mirantis.com</email>
</author>
<published>2015-12-29T13:41:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/commit/?id=c11c8c432bde60e6ef652119186aa205c3bf3076'/>
<id>c11c8c432bde60e6ef652119186aa205c3bf3076</id>
<content type='text'>
When no token or endpoint, it creates a session and from there
taken the necessary values.
This commit proposes to transfer a session in such cases.
This will avoid unnecessary actions and some of the problems.

Change-Id: Idc874b6c01e915e52904604d59e8e0b460e71621
Partial-bug: #1519546
(cherry picked from commit bda34034eb74023ffb1edf4a0c26aa574da0926d)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When no token or endpoint, it creates a session and from there
taken the necessary values.
This commit proposes to transfer a session in such cases.
This will avoid unnecessary actions and some of the problems.

Change-Id: Idc874b6c01e915e52904604d59e8e0b460e71621
Partial-bug: #1519546
(cherry picked from commit bda34034eb74023ffb1edf4a0c26aa574da0926d)
</pre>
</div>
</content>
</entry>
<entry>
<title>Use the subcomand parsed args instead of the base</title>
<updated>2015-10-14T11:45:00+00:00</updated>
<author>
<name>Flavio Percoco</name>
<email>flaper87@gmail.com</email>
</author>
<published>2015-10-08T10:47:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/commit/?id=57709f7538391c91c072e3eadbc4c6861ee79a30'/>
<id>57709f7538391c91c072e3eadbc4c6861ee79a30</id>
<content type='text'>
Pass the subcomand's arguments instead of the base ones to the endpoint
creation call when quering the `/versions` endpoint. Passing the wrong
arguments will end in the auth_requirement not being identified and an
error 'Expected Endpoint' will be raised as no endpoint will be gotten
from keystone.

This patch also removes an unnecessary mock in the test code related to
this fix.

Closes-bug: #1504058
Change-Id: I46088130b9175798e3719e43f48dc474fbc8a251
(cherry picked from commit 36937bbf6300a468f0eb1da5461c2edeb8d47a44)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pass the subcomand's arguments instead of the base ones to the endpoint
creation call when quering the `/versions` endpoint. Passing the wrong
arguments will end in the auth_requirement not being identified and an
error 'Expected Endpoint' will be raised as no endpoint will be gotten
from keystone.

This patch also removes an unnecessary mock in the test code related to
this fix.

Closes-bug: #1504058
Change-Id: I46088130b9175798e3719e43f48dc474fbc8a251
(cherry picked from commit 36937bbf6300a468f0eb1da5461c2edeb8d47a44)
</pre>
</div>
</content>
</entry>
<entry>
<title>No auth when token and endpoint are passed</title>
<updated>2015-09-25T15:52:41+00:00</updated>
<author>
<name>Flavio Percoco</name>
<email>flaper87@gmail.com</email>
</author>
<published>2015-09-25T08:54:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/commit/?id=76a91c9fbceffe660b4dc39813e435fc0b7cc6ac'/>
<id>76a91c9fbceffe660b4dc39813e435fc0b7cc6ac</id>
<content type='text'>
The latest change to the auth_required logic introduced a bug were even
when the token and endpoint were passed, authentication was being
required.

This patch fixes that issue and makes sure that authentication is not
required when these 2 arguements are present.

Closes-bug: #1499540

Change-Id: I4c9c15ba526378970da5461511ed922d42c5a9f9
(cherry picked from commit c31c1365573d10bd09afad47ca1974af3e50b5eb)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The latest change to the auth_required logic introduced a bug were even
when the token and endpoint were passed, authentication was being
required.

This patch fixes that issue and makes sure that authentication is not
required when these 2 arguements are present.

Closes-bug: #1499540

Change-Id: I4c9c15ba526378970da5461511ed922d42c5a9f9
(cherry picked from commit c31c1365573d10bd09afad47ca1974af3e50b5eb)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixes CLI client called without subcommands</title>
<updated>2015-09-11T12:56:08+00:00</updated>
<author>
<name>Erno Kuvaja</name>
<email>jokke@usr.fi</email>
</author>
<published>2015-09-10T10:10:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/commit/?id=160825f909cb1e0f876c2a040dbfb5aae5fd01d4'/>
<id>160825f909cb1e0f876c2a040dbfb5aae5fd01d4</id>
<content type='text'>
If CLI client is called without any subcommands or arguments it will
fail with """'Namespace' object has no attribute 'command'""". This
is coming from the getattr which does not have alternate value
specified.

Closes-Bug: #1494259

Change-Id: I461f0d4a91f3af2224bafc14a88572a8e4a3c051
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If CLI client is called without any subcommands or arguments it will
fail with """'Namespace' object has no attribute 'command'""". This
is coming from the getattr which does not have alternate value
specified.

Closes-Bug: #1494259

Change-Id: I461f0d4a91f3af2224bafc14a88572a8e4a3c051
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't make `help` require auth parameters</title>
<updated>2015-09-09T10:47:13+00:00</updated>
<author>
<name>Flavio Percoco</name>
<email>flaper87@gmail.com</email>
</author>
<published>2015-09-03T11:48:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/commit/?id=5026774bd1b8cdd079256a21cbbb74ba687267a9'/>
<id>5026774bd1b8cdd079256a21cbbb74ba687267a9</id>
<content type='text'>
The `help` command was behaving a bit funky. This patch re-orders the
code a bit so that the `help` command will be parsed at the very
beginning before running other commands and checks.

It also allows to get help without downloading/checking schemas and
without requiring auth credentials (previously required by the schema
operations).

Change-Id: Ib7b10d4d80f15e6b75bb8644d7d916bef09413d6
Closes-bug: #1490457
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `help` command was behaving a bit funky. This patch re-orders the
code a bit so that the `help` command will be parsed at the very
beginning before running other commands and checks.

It also allows to get help without downloading/checking schemas and
without requiring auth credentials (previously required by the schema
operations).

Change-Id: Ib7b10d4d80f15e6b75bb8644d7d916bef09413d6
Closes-bug: #1490457
</pre>
</div>
</content>
</entry>
<entry>
<title>Consider `--os-token` when using v2</title>
<updated>2015-09-04T11:31:55+00:00</updated>
<author>
<name>Flavio Percoco</name>
<email>flaper87@gmail.com</email>
</author>
<published>2015-09-02T12:58:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/commit/?id=1322fbc5d8323ff605c8b399fe0e1cb904b44f4e'/>
<id>1322fbc5d8323ff605c8b399fe0e1cb904b44f4e</id>
<content type='text'>
The `_cache_schemas` call currently forces authentication even when the
`auth_token` and `os_image_url` are passed. Instead of handling forced
authentications, let the client use the passed arguments and
authenticate only once if needed.

This was not caught by the existing tests because the call to
`_cache_schemas` was mocked.

Change-Id: I93cec9a68cafc0992d14dab38114d03e25f1e5da
Closes-bug: #1490462
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `_cache_schemas` call currently forces authentication even when the
`auth_token` and `os_image_url` are passed. Instead of handling forced
authentications, let the client use the passed arguments and
authenticate only once if needed.

This was not caught by the existing tests because the call to
`_cache_schemas` was mocked.

Change-Id: I93cec9a68cafc0992d14dab38114d03e25f1e5da
Closes-bug: #1490462
</pre>
</div>
</content>
</entry>
<entry>
<title>Check if v2 is available and fallback</title>
<updated>2015-09-04T11:31:55+00:00</updated>
<author>
<name>Flavio Percoco</name>
<email>flaper87@gmail.com</email>
</author>
<published>2015-09-01T21:28:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/commit/?id=47423ebbb2dfcb0d63aefcb87a9bec85420a7a99'/>
<id>47423ebbb2dfcb0d63aefcb87a9bec85420a7a99</id>
<content type='text'>
We have a basic implementation for a fallback mechanism that will use v1
rather than v2 when downloading schema files from glance-api fails.
However, this is not sound. If the schemas are cached already, we won't
check if v2 is available and fail to fallback.

This patch fixes the aforementioned issue by getting the list of
available versions from the server only when the API versions was not
explicitly specified through the CLI. That is, for all commands that
don't pass `--os-image-api-version 2`, we'll check v2's availability and
we'll fallback to v1 if it isn't available.

This patch also changes how we handle `/versions` calls in the client.
The server has been, incorrectly, replying to requests to `/version`
with a 300 error, which ended up in the client re-raising such
exception. While I think 300 shouldn't raise an exception, I think we
should handle that in a spearate patch. Therefore, this patch just
avoids raising such exception when `/version` is explicitly called.

This fallback behaviour and the check on `/versions` will be removed in
future versions of the client. The later depends on this bug[0] being
fixed.

[0] https://bugs.launchpad.net/glance/+bug/1491350

Closes-bug: #1489381
Change-Id: Ibeba6bc86db2a97b8a2b4bd042248464cd792e5e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have a basic implementation for a fallback mechanism that will use v1
rather than v2 when downloading schema files from glance-api fails.
However, this is not sound. If the schemas are cached already, we won't
check if v2 is available and fail to fallback.

This patch fixes the aforementioned issue by getting the list of
available versions from the server only when the API versions was not
explicitly specified through the CLI. That is, for all commands that
don't pass `--os-image-api-version 2`, we'll check v2's availability and
we'll fallback to v1 if it isn't available.

This patch also changes how we handle `/versions` calls in the client.
The server has been, incorrectly, replying to requests to `/version`
with a 300 error, which ended up in the client re-raising such
exception. While I think 300 shouldn't raise an exception, I think we
should handle that in a spearate patch. Therefore, this patch just
avoids raising such exception when `/version` is explicitly called.

This fallback behaviour and the check on `/versions` will be removed in
future versions of the client. The later depends on this bug[0] being
fixed.

[0] https://bugs.launchpad.net/glance/+bug/1491350

Closes-bug: #1489381
Change-Id: Ibeba6bc86db2a97b8a2b4bd042248464cd792e5e
</pre>
</div>
</content>
</entry>
<entry>
<title>Password should be prompted once</title>
<updated>2015-09-01T16:03:41+00:00</updated>
<author>
<name>Flavio Percoco</name>
<email>flaper87@gmail.com</email>
</author>
<published>2015-09-01T16:03:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/commit/?id=1e2274aef011c143ef0ae421b45755babaff3652'/>
<id>1e2274aef011c143ef0ae421b45755babaff3652</id>
<content type='text'>
There's a corner case where password may be requested twice. In a fresh
environment, when schemas have not be downloaded for v2, the client will
ask for a password to download the schemas and then it'll ask for the
password again to run the actual command. This happens because we parse
the CLI arguments twice to make sure we're parsing them for the right
client version.

This patch checks if the password is unset in the newly parsed arguments
and if it's been set in the previously parsed ones. In this case it
keeps the set password. I believe this approach is safer than re-using
the already parsed arguements which may have been parsed for a different
API version (might happen because we fallback to v1 if v2 is not
available).

Change-Id: I080253170e3e84a90363e5bb494cf137895fe2e7
Closes-bug: #1488892
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's a corner case where password may be requested twice. In a fresh
environment, when schemas have not be downloaded for v2, the client will
ask for a password to download the schemas and then it'll ask for the
password again to run the actual command. This happens because we parse
the CLI arguments twice to make sure we're parsing them for the right
client version.

This patch checks if the password is unset in the newly parsed arguments
and if it's been set in the previously parsed ones. In this case it
keeps the set password. I believe this approach is safer than re-using
the already parsed arguements which may have been parsed for a different
API version (might happen because we fallback to v1 if v2 is not
available).

Change-Id: I080253170e3e84a90363e5bb494cf137895fe2e7
Closes-bug: #1488892
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge "Use API v2 as default"</title>
<updated>2015-08-13T23:43:59+00:00</updated>
<author>
<name>Jenkins</name>
<email>jenkins@review.openstack.org</email>
</author>
<published>2015-08-13T23:43:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/commit/?id=13af69039671d842167cb66e25b0dfbd1ce89724'/>
<id>13af69039671d842167cb66e25b0dfbd1ce89724</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Ship the default image schema in the client</title>
<updated>2015-08-12T09:10:54+00:00</updated>
<author>
<name>Flavio Percoco</name>
<email>flaper87@gmail.com</email>
</author>
<published>2015-08-05T14:19:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/python-glanceclient.git/commit/?id=3949e0e918e2501c4953a7d9beb58511688d84e1'/>
<id>3949e0e918e2501c4953a7d9beb58511688d84e1</id>
<content type='text'>
Now that we have stable branches for clients, it's easier to keep track
of the current default image's schema in Glance and update it
respectively. This patch adds the current image schema, including the
schema-properties.

One good reason to do this is to be able to react when a running Glance
instance is not around to be introspected. It's really unfortunate that
things like help text can't be rendered when there image schema is not
available in the system.

We could keep the schema in a json file but rather than shipping data
files with glanceclient we can just have it in the python modules.

Change-Id: I9b8cc1d18d6717ccf991fb8149ab13c06d653ee4
Closes-bug: #1481729
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we have stable branches for clients, it's easier to keep track
of the current default image's schema in Glance and update it
respectively. This patch adds the current image schema, including the
schema-properties.

One good reason to do this is to be able to react when a running Glance
instance is not around to be introspected. It's really unfortunate that
things like help text can't be rendered when there image schema is not
available in the system.

We could keep the schema in a json file but rather than shipping data
files with glanceclient we can just have it in the python modules.

Change-Id: I9b8cc1d18d6717ccf991fb8149ab13c06d653ee4
Closes-bug: #1481729
</pre>
</div>
</content>
</entry>
</feed>
