Commit Graph

13 Commits

Author SHA1 Message Date
Sean McGinnis 3eafa2a001
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I4a5b1ec999110a50fc904f3ae93e3983efa64f88
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:58:37 -05:00
maliki 7829c8c901 Add missing options for HTTPClient if auth_token given.
The insecure client options and timeout were bypassed
if auth token was given, as in case of Magnum UI.
This is causing SSL error even insecure is set to true
by Magnum UI and magnum client is unable to skip SSL check
becuase insecure option was not passed to HTTPClient.
This was caused due to this change :
a374b9f99c (diff-c8d8ebbd1f15e85c914906c6357e0a5f)
As a consequence, any HTTPS based connections to magnum endpoint
fail. With this patch, the missing options to HTTPClient are
correctly passed to and SSL checks are skipped safely if insecure
is set to True.

Change-Id: I885301d6eb69182f109cdfbfbc771bbbf13beb2a
Closes-Bug: #1634305
2016-10-17 17:47:53 -07:00
OTSUKA, Yuanying a738ea7911 Add microversioning support for httpclient
This patch adds 'OpenStack-API-Version' header for each
requests.

Change-Id: I49310f1b53447ce00e78e26661cc895ce4f1c4e5
Implements: blueprint api-versioning
2016-08-29 14:48:39 +09:00
OTSUKA, Yuanying a374b9f99c Fix to use HttpClient if token is given
Currently, magnumclient doesn't work with token and endpoint_override.
Due to cloud_config limitation. This issue breaks magnum horizon plugin.
This patch fixes it.

Change-Id: I0d0a41e72a1a806c4422c2dcde2b86e9889bc35f
Closes-Bug: #1616315
2016-08-25 08:16:50 +09:00
OTSUKA, Yuanying f2c49d203b Use os-client-config in shell
Use os-client-config[1] to process options and get the Session from
keystoneauth1. This adds support for reading clouds.yaml
files and supporting the OS_CLOUD env var for selecting named clouds
from a list of them.

[1]: https://github.com/openstack/os-client-config

Closes-Bug: #1599747
Change-Id: I23a6e80648e67c0b652693cd146bd9e94ad4fb23
2016-07-25 13:44:34 +09:00
Hongbin Lu e0966ebe60 Switch to a new service type "container-infra"
After this patch [1], Magnum is no longer the "Container Service", it
became the "Container Infrastructure Management Service". Based on the
decision, this patch proposed to rename Magnum service type from
"container" to "container-infra". The old service type will be
deprecated and eventually not supported.

There is another patch [2] on Magnum server side for the renaming.
This patch should land first, then the server patch.

[1] https://review.openstack.org/#/c/311476/
[2] https://review.openstack.org/#/c/319300/

Change-Id: I55205ff2b304678d2b53bbd4d66403078c6baac8
Closes-Bug: #1584251
2016-05-20 17:46:56 -05:00
Yolanda Robla 85fc6c1756 Add endpoint_override parameter to python-magnumclient
When trying to consume python-magnumclient from os-cloud-config,
it is failing with:

TypeError: __init__() got an unexpected keyword argument 'endpoint_override'

That is because this parameter is not supported in v1 from magnumclient. Add the
parameter, forcing to be the equivalent of magnum_url.

Change-Id: I3e9d41c3efabf23826f35fc8d1bb12c14770460b
Closes-Bug: 1573468
2016-04-22 13:03:21 +02:00
Ian Cordasco 5119ee0a67 Add Keystone v3 compatibility
Change-Id: Ib15713b52710412d3a887f399d1684c0e3fc5475
Closes-bug: #1538302
2016-01-27 08:42:56 -06:00
Corey O'Brien db4dec5276 Add --insecure option
Adds insecure option and associated MAGNUMCLIENT_INSECURE environment
variable for skipping SSL certificate verifcation in the client.

Change-Id: I0396453e8315c5f24703161457c91f7640827b8d
2016-01-20 17:12:57 -05:00
Monty Taylor 5cbc5e722e Use keystoneauth to create a Session
All client interactions should actually flow through a keystoneauth
Session. Add the parameter for a user to pass one in, but support
the old style of direct parameters too. A followup patch will add
os-client-config support to the shell, so add that to requirements.txt
instead of keystoneauth directly to look forward.

Also, trim unneeded things from requirements.txt because we're adding
os-client-config which pulls in various things.

Closes-Bug: #1514733
Change-Id: I88b1d0e4e119429599dec75c5db24237a92edcec
2015-11-11 18:51:18 +01:00
Cedric Brandily 1b14206ac9 Delegate magnum url search to url_for method
This change removes homemade code to search magnum endpoint and uses
keystoneclient url_for method.

Closes-Bug: #1444409
Change-Id: Ida5fc20bd4ee46ec2d6846a31c3ec79e216b73f2
2015-04-17 08:49:22 +00:00
Cedric Brandily 431554b43e Remove side effect in get_keystoneclient
Currently get_keystoneclient uses a side effect (keystone_client
attribute) to cache keystone client instance but it's not more required
as get_keystoneclient is called at most once, thanks to parent changes.

Closes-Bug: #1444405
Change-Id: I832f4ef90fd9ec32ebf4d97675379b73620b0646
2015-04-17 08:49:04 +00:00
Cedric Brandily 115d17320e Add unittests for magnumclient.v1.client module
This change adds unittests for magnumclient.v1.client module in order to
check its behavior and avoid regressions.

Closes-Bug: #1444398
Change-Id: Ib41563bdcd83620930a866f2c184d8c1e0994762
2015-04-17 10:48:12 +02:00