16 Commits

Author SHA1 Message Date
Steve Martinelli
16f83c4a53 Switch to keystoneauth
move cinderclient to keystoneauth as keystoneclient's auth session,
plugins and adapter code has been deprecated.

Co-Authored-By: Paulo Ewerton <pauloewerton@lsd.ufcg.edu.br>
Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: Jamie Lennox <jamielennox@gmail.com>

Change-Id: Id4bf0e2088e8ad99e83cd4f9b8549c2aca1f65a2
2016-07-23 07:35:40 +10:00
Jenkins
b36ff1fc15 Merge "Fix authentication issue" 2016-07-15 20:58:36 +00:00
Jenkins
835747d40f Merge "Fix argument order for assertEqual to (expected, observed)" 2016-06-14 15:39:48 +00:00
reedip
ea2693b9d9 Fix argument order for assertEqual to (expected, observed)
assertEqual expects that the arguments provided to it should be
(expected, observed). If a particluar order is kept as a convention,
then it helps to provide a cleaner message to the developer if Unit
Tests fail. The following patch fixes this issue.

TrivialFix

Change-Id: I817a654733e0f3886ca85778a49aa579592f60ff
Closes-Bug: #1259292
2016-06-14 08:27:32 +00:00
Cedric Brandily
80d3edc71e Support --os-key option
Currently we can specify a client certificate key using --os-key option
inherited from keystoneclient cli options but it has no effect because
keystoneclient Session expects as cert argument, one of the followings:
 * None (no client certificate),
 * a path to client certificate,
 * a tuple with client certificate/key paths.

The change updates cinderclient code to support the last case (ie:
os_cert and os_key are non-empty) in order to take into --os-key option
and OS_KEY environment variable.

Closes-Bug: #1564646
Change-Id: I258fd554ad2d6a5413ffe778acefa3a0b83e591f
2016-05-17 15:02:00 +02:00
Abhijeet Malawade
24deab1090 Fix authentication issue
Fix authentication issue if password is provided from tty prompt.
Set options.os_password to user input from prompt, as it gets
used to create auth object otherwise it will give authentication error.

Change-Id: I0246473f2165f1464d731e0ae9b4afa0b61dcbcc
Closes-Bug: #1575656
2016-04-27 06:37:19 +05:30
Cory Stone
b670b73e44 Pass insecure option to HTTPClient
This option was silently being ignored.

Closes-Bug: #1538648
Change-Id: I3a1b5268e87cbc9803924be95b374d76b72a3a5d
2016-01-27 15:11:41 -06:00
Derrick J. Wippler
e8274fa57d No longer ignores CINDER_SERVICE_NAME
Cinderclient now utilizes the CINDER_SERVICE_NAME when deciding what
endpoint to choose.

Closes-Bug: #1486256
Change-Id: I494a34afe5799e7832b1359b9c24c31ead68b6d1
UpgradeImpact: Existing configurations may select a different endpoint
after this patch.
2015-09-14 08:49:14 -05:00
Derrick J. Wippler
50758ba475 Fixed test_password_prompted
test_password_prompted no longer makes DNS lookups on the network.

Change-Id: If310f52e829b09b01c76d02deae4aec74f00870d
Closes-Bug: 1486647
2015-08-27 09:39:58 -05:00
Yusuke Hayashi
780a1299cb Replace assertEqual(None, *) with assertIsNone in tests
Replace assertEqual(None, *) with assertIsNone in tests to have
more clear messages in case of failure.

Change-Id: I7ea0306009e8fdde468c1394615972de4d296f45
Closes-Bug:#1280522
2015-08-09 15:57:00 +09:00
rico.lin
953f76650e New mock release(1.1.0) broke unit/function tests
Change-Id: Ia84c667b65fb69ba877bdb0ecb45827281539e03
Closes-Bug: #1473454
2015-07-14 18:51:58 +08:00
Mike Perez
1f52746bcb Revert "Enable version discovery"
This reverts commit ae03d2a721bd9acb61805ce792a27fb7cf88e5cd.

Cases where a deployment is using a proxy, Cinder servers won't return
the expected publicURL, and instead gives an internal URL that the
client can't use.

Commit 2eb25ab8803214cb3beb5d8fe3efbf70a462c414 in Cinder introduces the
public_endpoint config option, but not everyone is expected to be
running that later of a version to take advantage of this.

Closes-Bug: #1464160
Change-Id: I61228c1e8630b958c792be077674b48fbdb83135
2015-07-02 11:57:33 -06:00
Derrick J. Wippler
e3a0556e56 Avoid _get_keystone_session() if auth_plugin
Avoid calling _get_keystone_session() if auth_plugin is provided by the
user

Closes-Bug: 1421433
Change-Id: I37a7139107c357caf1a25ac3d0a3457afade0f83
2015-05-07 14:46:55 -05:00
Mike Perez
4ea65b4409 Add version removal rule to stop discovery warning
Cinder recently added version discovery leveraging Keystone Client. For
cases where the service catalog still contains version numbers, this can
result in Keystone attempting to do discovery at the base url with the
version number and giving warnings. This will set a version removal rule
so Keystone can find the correct base url.

Change-Id: I71432468fea8bf1e50f180ab7f6dd69ee9aaa7e6
Closes-Bug: #1448244
2015-04-29 09:29:01 +10:00
Mike Perez
ae03d2a721 Enable version discovery
The service catalog can now have the cinder endpoint x.x.x.x:8776 with
service_type volume, without needing to specify a version in the
endpoint. Keystone will do discovery of the root / GET of the Cinder API
to discover the versions that can be talked to.

This also provides backwards compatibility for the previous solution of
having v1 enabled on service_type volume and v2 on service_type
volumev2.

Change-Id: Id0347f8370dbc8fd7fa8096cd5859e10b0c5d67c
2015-04-20 15:50:08 +00:00
John Griffith
e5a1304791 Move unit tests into test directory
This is the first step of moving functional testing
into the project tree.  This change just moves
all of the unit tests to be under a dedicated tests/unit
directory.

Follow up patches will add the functional directory and
start moving tempest CLI tests there.

Change-Id: I9dc0b8f761676c1b3bbdeb03e2f44b35f75c693e
2015-03-23 21:20:10 -06:00