summaryrefslogtreecommitdiff
path: root/openstackclient/network/client.py
Commit message (Collapse)AuthorAgeFilesLines
* Blacken openstackclient.networkStephen Finucane2023-05-101-2/+4
| | | | | | | | | | Black used with the '-l 79 -S' flags. A future change will ignore this commit in git-blame history by adding a 'git-blame-ignore-revs' file. Change-Id: I8048746dbc2ef0cb582f68934734db4c1153d779 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Make Profile fallback go bye-byeMonty Taylor2018-03-141-41/+11
| | | | | | | | | | | It's time to move on with life. (dtroyer) This requires sdk >= 0.10.0 (0.9.19 is in global-requirements.txt) and osc-lib >= 1.8.0 (1.8.0 is already in g-r). Once we have sdk bumped make_client() becomes just a pass-through for the plugin interface and existing code compatibility. Change-Id: Ie3d7c442da4257b11140c109e9df69b629336f42
* Fix use of new openstacksdk connectionMonty Taylor2018-01-231-0/+1
| | | | | | | We store the created conn on the instance, but we never pull it back off if there is already one present. Change-Id: I2d890dd206d4ddf67fa42d798e6fd2c652799785
* Rework Network client config for new SDK ConnectionDean Troyer2018-01-221-19/+26
| | | | | | | | network.client.make_client() has always put a copy of it's SDK Connection directly into ClientManager, the new-style Connection create will move into osc-lib ClientManager, do it here too until then. Change-Id: I1edfd19c9e73320768fb9640931fafe857c980b4
* Fix SDK Connection creation alternative to ProfileDean Troyer2017-12-071-3/+8
| | | | | | | | | Do a dummy import to determine which SDK is installed (Pre/post merge). This solves the DevStack error "Cloud defaults was not found" in -tips jobs. Depends-On: Ia111f127fbdceac2afe20fd9d1fe032145cdd72c Change-Id: I60c2d418dd5a393eee2cc2a5c2fdebfffdabf2d3
* Add logic to handle old and new sdk constructorMonty Taylor2017-11-161-9/+18
| | | | | | | | | | | SDK is removing Profile, but currently has compat code to support this invocation in OSC. While the intent is to protect people from upgrade breakage, it's python, and packaging things have a tendency to get strange. By putting in a little belt and suspenders if block here, we can hopefully protect folks who upgrade sdk for some reason without upgrading python-openstackclient. Change-Id: Id678e97a2b99dbbfc772acc8c6ba283db551723d
* Remove remaining uses of SDK Proxy.sessionDean Troyer2017-02-191-0/+5
| | | | | | | SDK commit Ie67c240e3caa5e100ce07db3862718195c894748 exposed lingering uses of Proxy.session in OSC. Get rid of them. Change-Id: Icab230f1897a446cf3deb0e3d0550d24e11a0ef3
* osc-lib: shellDean Troyer2016-08-051-2/+2
| | | | | | | | | | | | | Convert to using ClientManager and OpenStackShell from osc-lib. * Change all internal uses of ClientManager private attributes that are now public in osc-lib's ClientManager. Leave back-compat copies in place in OSC's clientManager so we don't break plugins. * Put some work-arounds in place for changes in osc-lib that we need until a new release makes it through the g-r and u-c change process. * Add a test for Unicode decoding of argv in shell.main() to parallel the one in osc-lib. Change-Id: I85289740d4ca081f2aca8c9b40ec422ad25d302c
* Ensure endpoint type is used for network commandsStuart McLaren2016-06-141-0/+1
| | | | | | | | | | | | | Currently OS_ENDPOINT_TYPE and --os-interface are being ignored for network commands. This means the public URL is always used. Make sure that these are picked up correctly so we hit the correct endpoint (internal/admin/etc.) for commands such as: $ openstack --os-interface internal network list Change-Id: Iac05204e3056e386d84d3644b5da1a2bb322bb0a Closes-bug: 1592368
* osc-lib: utilsDean Troyer2016-06-131-1/+1
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* Trivial: Fix i18n support in network/common.pyTang Chen2016-05-311-3/+4
| | | | | | Some missing i18n problems in network. Change-Id: I45a09a6ada1aad5a64256c0d0a0a2b6e250df670
* Fix client certificate/key support for Network v2 commandsCedric Brandily2016-04-191-1/+3
| | | | | | | | | | | | | | Currently network v2 commands don't support client certificate/key because they were not passed to OpenStackSDK Connection which is used by network v2 commands. This changes corrects the integration with OpenStacKSDK to pass client certificate/key. Closes-Bug: #1569513 Related-Bug: #1569508 Depends-On: Ic093f8515e7b15931994e4516ebec8f4399d021e Change-Id: Ie37e8e988ca695a09894c6c93560dacd83f17030
* Initialize neutron client with region nameAndrey Larionov2016-04-181-1/+5
| | | | | | | | | All clients except neutron are initialized with region name. This makes unable to use network related commands of openstackclient in multi-region configurations Change-Id: I200dc9a2f938c3e69357f91c79810df167e4fccb Closes-bug: 1570491
* Fix SSL/TLS verification for network commandsRichard Theis2016-04-081-1/+2
| | | | | | | | | | | The network commands ignored the --insecure and --os-cacert options and OS_CACERT environment variable which prevented them from properly completing SSL/TLS verification. This resulted in the network commands failing with "An SSL error occurred." Change-Id: I15167631ef58335e1476c16b828b079e3b0f13c1 Closes-Bug: #1560157
* Migrate network client to SDK.Tang Chen2015-12-091-52/+10
| | | | | | | | | | | | | | | | | | | The previous patches have migrate all network commands to the new version using sdk. This patch will remove the temporary method, and implement a new make_client() to create sdk network client. And also, find() in openstackclient/network/common.py must support sdk. The logic of this function will become much easier than before, so this patch also removes two useless test cases of find(). This patch will also remove the patched methods in tests. Change-Id: Ic2f7bca073beb9757172d16f95d9b82c48cbbc12 Implements: blueprint neutron-client Co-Authored-By: Terry Howe <terrylhowe@gmail.com> Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
* Set default network api to 2.0 instead of 2Monty Taylor2015-11-091-1/+3
| | | | | | | | | | | | neutronclient expects 2.0 as the version if you go through the discovery constructor. For that reason, 2.0 is the 'correct' version to set in config files or environment variables for if you're using things that are not OSC. However, if you do that, OSC prints a warning that 2.0 is not in the supported network version list. Let's support both so that users don't get a confuse. Change-Id: I7412519693f75fcd29f5621ce9e5a2df2da92684
* Do not set default versions in parsed argsTerryHowe2015-07-181-5/+3
| | | | | | | | | | | Setting default versions in parsed args makes it so OCC cannot tell if the argument was parsed, an environment variable was set or it is just defaulted. In order to set api versions from OCC, it will have to be defaulted after processing OCC. Closes-Bug: #1453229 Change-Id: I4d065919397b783f3bdd4022c986c0234a7a16e6
* Rename endpoint type to interfaceTerryHowe2015-07-151-3/+2
| | | | | Change-Id: I4e21d09bc747e8210f4f79a1d6c4c7ccf2f25d1c Closes-Bug: #1454392
* Add --os-endpoint-type cli optional argumentRoxana Gherle2015-07-021-0/+6
| | | | | | | | | | | | User should be able to specify the endpoint type through a CLI optional argument/ENV variable setting. We will name this new optional argument: --os-endpoint-type (Env: OS_ENDPOINT_TYPE) and based on the value given, the service API will use that specific endpoint type. Possible values: public, admin, internal. DocImpact Closes-Bug: #1454392 Change-Id: Ife3d4e46b44c0ddcd712b1130e27e362545a9a29
* Begin low-level API for Network v2Dean Troyer2015-01-221-2/+35
| | | | | | | | | api.network.APIv2 starts with network_list() support to flush out the skeleton of the Network API. list_dhcp_agent() supports the --dhcp option of 'network list' Change-Id: I9a2b90cde84eced1f2ea6a014b769e2bae668211
* Use session for neutron clientVladimir Eremin2015-01-151-13/+1
| | | | | | | | | | python-openstack client is now using sessions to create clients. This patch implements creating Network client using sessions. Related to c3c6edbe8a083aef0fb6aea3cb461ff8e715fc59 Change-Id: If90ac705eb11dfc1e3abbe2ce18c3d8ccefdbdfb Closes-Bug: 1411179
* Remove ClientManager._service_catalogDean Troyer2014-10-181-4/+6
| | | | | | | | | | Anything that needs a service catalog can get it directly from auth_ref.service_catalog, no need to carry the extra attribute. ClientManager.get_endpoint_for_service_type() reamins the proper method to get an endpoint for clients that still need one directly. Change-Id: I809091c9c71d08f29606d7fd8b500898ff2cb8ae
* Remove now-unnecessary client creation hacksDean Troyer2014-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | Clients that can use ksc Session don't need the old junk to fake auth anymore: * compute * volume Clients that still need to be fed credentials can pick directly from the auth object in clientmanager. The _token attribute is removed, the token can be retrieved from the auth object: openstackclient/tests/common/test_clientmanager.py This change will break any plugin that relies on getting a token from instance._token. They should be updated to use the above, or preferable, to use keystoneclient.session.Session to create its HTTP interface object. Change-Id: I877a29de97a42f85f12a14c274fc003e6fba5135
* Fix operation on clouds with availability-zonesMonty Taylor2014-10-111-1/+2
| | | | | | | | | In a cloud with AZs, you can get multiple entries back from the service catalog - one for each AZ and then one that is AZ agnostic that's tied to the region. If the region_name is plumbed all the way through, this works as intended. Change-Id: I3b365ea306e8111fc80830672ae8080a5d1dc8e0
* Clean up make_client() loggingDean Troyer2014-07-081-0/+2
| | | | Change-Id: I0b6760a6401b50e3dfb891af75424ae89df42ebc
* Move network stuff to v2 instead of v2_0Terry Howe2014-07-071-2/+2
| | | | | | Rename network stuff v2 Change-Id: Ia9b8feda20dfd35b0f3712b8e2419d0bf5da0acd
* Network CRUDTerry Howe2014-06-241-0/+61
bp/neutron https://wiki.openstack.org/wiki/OpenStackClient/Commands#Network_2 Change-Id: I89ee083154afa544b03587e84becace36d9d522a