summaryrefslogtreecommitdiff
path: root/openstackclient/common
Commit message (Collapse)AuthorAgeFilesLines
* Switch image to use SDKArtem Goncharov2020-03-231-0/+60
| | | | | | | | | | | | | This is a work to switch OSC from using glanceclient to OpenStackSDK. With this change only v2 is using OpenStackSDK. V1 is still using glanceclient and will be switched in a separate change. Remove the direct depend on keystoneauth- let that flow through openstacksdk. Depends-on: https://review.opendev.org/#/c/698972 Change-Id: I36f292fb70c98f6e558f58be55d533d979c47ca7
* Merge "Show correct name for resource with quota set to zero"Zuul2020-01-141-1/+1
|\
| * Show correct name for resource with quota set to zeroAlex Katz2020-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case quota for the resource is set to zero "openstack quota show" command will not map the resource name according to one of the following dicts: - COMPUTE_QUOTAS - NOVA_NETWORK_QUOTAS - VOLUME_QUOTAS - NETWORK_QUOTAS For example: $ openstack quota set --secgroups 10 admin $ openstack quota show admin -f json|egrep "(secgroups|security_groups)" "secgroups": 10, $ openstack quota set --secgroups 0 admin $ openstack quota show admin -f json|egrep "(secgroups|security_groups)" "security_groups": 0, Change-Id: I94ed9e6b41b1cc692297c01e6c7582998dcacfda
* | Replace six.iteritems() with .items()lihaijing2020-01-094-10/+6
|/ | | | | | | | | | | | | | | | 1. As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2. In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Co-Authored-By: Akihiro Motoki <amotoki@gmail.com> Change-Id: I4b9edb326444264c0f6c4ad281acaac356a07e85 Implements: blueprint replace-iteritems-with-items
* common: autogenerate docsEric Fried2019-11-052-15/+42
| | | | | | | | | | | | | | | | | $namespace = openstack.common The subcommand documents for $namespace were hardcoded and thus prone to drift over time. This commit removes the hardcoded content and uses the autoprogram-cliff directive to generate them automatically from the subcommand configuration classes. This incorporates a correction to `openstack versions show`: The command `openstack versions show --help` showed a copy/paste error, using <region-name> for the metavar for both --service and --status. Fix. Change-Id: I7658fed40d71f4c20ee27908ade433534657cfe5 Co-Authored-By: Pierre Prinetti <pierreprinetti@redhat.com> Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>
* Merge "Use SDK to get compute API extensions"Zuul2019-11-041-2/+2
|\
| * Use SDK to get compute API extensionsMatt Riedemann2019-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | python-novaclient 16.0.0 removed the deprecated list_extensions module [1] so this changes the extensions command to use openstacksdk to get the compute API extensions. The functional test ExtensionTests.test_extension_list_compute ensures this works. [1] https://review.opendev.org/686516/ Change-Id: I9894bc395c0474aaa6494ac4534862efe4ea7984 Story: #2006769 Task: #37284
* | versions: Fix 'versions show' help messagePierre Prinetti2019-11-011-2/+2
|/ | | | | | | The command `openstack versions show --help` shows a copy-paste nit. Change-Id: I9e4e86429ffd630c566bbdf2929e7995c9b0dbe1 Signed-off-by: Pierre Prinetti <pierreprinetti@redhat.com>
* Clean up app initialization and configDean Troyer2019-09-091-71/+0
| | | | | | | | | | | | * Remove unnecessary code in OpenStackShell.initialize_app() - only the bits it instantiate our subclass of ClientManager remain * Remove OSC_Config - with https://review.opendev.org/#/c/678095/ the last remaining required bit moves to osc-lib Thos requires osc-lib 1.14.0 Change-Id: Ia4b3c737de9dc34949e74632441621014ef9eea9 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* Make configuration show not require authDean Troyer2019-08-011-5/+15
| | | | | | | | | | | | | | The configuration show should not require auth to just display the OSC config object. Changes to make it not require auth have knock-on effects of needing to change a bunch of tests that use it assuming it _does_ require auth so change those to use 'extension list' instead. This sets up further testing of the command line options for changes in behaviour when we switch to straight SDK usage for configuration. Change-Id: I6c52485341214ba401064c0f2d1e2b95fdc225c0 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* Remove code migrated to osc-lib long agoDean Troyer2019-05-162-66/+0
| | | | | | | | | * Remove openstackclient.api.utils and use osc_lib.api.utils * Remove openstackclient.common.clientmanager.ClientManager.auth_ref * Remove openstackclient.common.commandmanager Change-Id: I67e1dbc53cc0b37967c0011bcb2fc09bdef62d94 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* Merge "Delete the LB object quotas set command in openstackclient"Zuul2019-03-131-3/+0
|\
| * Delete the LB object quotas set command in openstackclientyanpuqing2018-06-201-3/+0
| | | | | | | | | | | | | | | | | | | | | | Setting octavia quotas should use "openstack loadbalancer quota set", not "openstack quota set". The vip parameter had be removed from octavia. The patch removes '--vips', '--health-monitors', '--l7policies' parameter in "openstack quota set" command. Change-Id: Id0046195aa93bae62264d9de7d123cf63bd0fb7e Task: 19657 Story: 2002016
* | Mention compute API 2.50 in openstack quota show --classMatt Riedemann2019-03-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | There is a bug in the compute API until microversion 2.50 where the server-groups and server-group-members class quota fields aren't returned. This just mentions that microversion in the command help text. Change-Id: I029a614a922d642c578618c478c4d0a29a394fc2 Task: 21490 Story: 2002194
* | Add support for get details of QuotaSławek Kapłoński2019-02-241-64/+167
| | | | | | | | | | | | | | | | | | | | With passing "--detail" argument to "openstack quota list", details about current usage should be returned. It is currently supported by Nova and Neutron so details of resources from those projects can be returned. Change-Id: I48fda15b34283bb7c66ea18ed28262f48b9229fe Related-Bug: #1716043
* | Make use of keystoneauth service-type filtering for versionsMonty Taylor2018-10-191-14/+2
| | | | | | | | | | | | | | | | | | The first version of the versions show command does client-side service-type filtering, which while functional, causes many more API calls than needed. Now that keystoneauth supports the filtering at the source, use it. Change-Id: I57c49e67f9cb285a5f5bc19ec53a42d10de9f0da
* | Fix 'project purge' deleting wrong project's servers and volumesJulie Pichon2018-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Project purge would delete the servers and volumes for the project the user is currently authenticated for, regardless of the --project flag. Note: This change means that no server at all will be deleted if the logged in user doesn't have the get_all_tenants permission set in the Nova policy (default: admin_api). This doesn't appear to be an issue with Cinder as the default rule appears to be admin_or_owner. Change-Id: If1c54e24e1482438b81c3c32fd5fc9fdd7a7be04 Story: 1747988 Task: 13854
* | Add command to show all service versionsMonty Taylor2018-07-231-0/+114
|/ | | | | | | | | | Knowing what services and what versions of those services exist on a cloud isn't always a spectacular experience. Add a command that will use get_all_version_data from keystoneauth to produce a report of the available services and the version info for each service. Depends-On: https://review.openstack.org/584944 Change-Id: I84751c175d0c5f6d857a5473d2db6d5f1b41f946
* Merge "Fix limits show command without Nova and Cinder"Zuul2018-04-232-11/+40
|\
| * Fix limits show command without Nova and CinderJude Cross2018-04-032-11/+40
| | | | | | | | | | | | | | | | | | This patch implements an endpoint lookup when showing limits. This addresses the issue when showing limits without both Nova and Cinder and will display limits if one is missing. Change-Id: I2214b281e0206f8fe117aae52de2bf4c4e2c6525 Closes-bug: #1707960
* | Clean up W503 and E402 pep8 errorsSean McGinnis2018-04-151-2/+4
|/ | | | | | | | | | | | pycodestyle 2.40 and later enforce these rules that were not previously enforced. Rather than just skipping them, this cleans up the trivial instances of these violations. This does also include some other updates that were not triggering errors in an attempt to keep some of the style consistent. Change-Id: Id7c0a6b8f1f835e69d844b000e3ed751852ada63 Closes-bug: #1762803
* Remove a bunch of things we promised to remove in 2H 2017Dean Troyer2017-11-307-220/+0
| | | | Change-Id: I060559fe13e354fe87551cd9dd82774bddb54640
* Replace %r with %s on printing string variableHongbin Lu2017-11-131-2/+2
| | | | Change-Id: Idd8c15255f024bba7079d3a9a29545dec0c91b58
* Be robust on import plugin moduleHongbin Lu2017-10-071-1/+7
| | | | | | | | | On loading external plugin, OSC should be robust on importing the plugin module so that commands from other modules can continue to execute. Closes-Bug: #1722008 Change-Id: Ibe716681c7f78fabee31b7ef281af2588d68ab30
* Fix 'project purge' deletes ALL images problemlihaijing2017-09-261-1/+8
| | | | | Closes-Bug: #1717130 Change-Id: I33c6fc7897dfee85d1c197a1267bde4abfa5bbd9
* Use flake8-import-order pluginAkihiro Motoki2017-08-171-1/+1
| | | | | | | | | | | | | | | | In reviews we usually check import grouping but it is boring. By using flake8-import-order plugin, we can avoid this. It enforces loose checking so it sounds good to use it. This flake8 plugin is already used in tempest. Note that flake8-import-order version is pinned to avoid unexpected breakage of pep8 job. Setup for unit tests of hacking rules is tweaked to disable flake8-import-order checks. This extension assumes an actual file exists and causes hacking rule unit tests. Change-Id: I12b596820727aeeb379bee16c2bc993dee9eb637
* wrong values in openstack quota show commandnidhimittalhada2017-07-241-5/+21
| | | | | | | | | | | "openstack quota show" shows wrong value in field project and project_id. project UUID is shown in field project. and project is coming as None. Corrected it. Change-Id: I237e49858feab14ec5e5bc6d8cb79c9f6f5ea9c0 Closes-Bug: #1679906
* Add project purge command to oscSteve Martinelli2017-06-131-0/+168
| | | | | | | | | See the initial implementation: https://github.com/openstack/ospurge/blob/master/ospurge/client.py Partial-Bug: 1584596 Change-Id: I3aa86af7c85e7ca3b7f04b43e8e07125f7d956d1
* Refactor Extension show and list commandAnkur Gupta2017-05-181-35/+14
| | | | | | | | | | | | | | 1.keep the column display order consist in extension list with and without "--long" option. 2.rework for network extentsion list, openstacksdk return object, so the logic should be same with other service. 3.add some unit test cases, like: extension list --network --long, extension list --network --compute, to cover regular use cases. 4.raise exact exception when network extension don't exist, avoid internal TypeError in "extension show" commands. Change-Id: I2e23ced80d8da8aa1106b22472db850367b351ce Closes-Bug: #1689233
* Ignore more exceptions in quota listDean Troyer2017-05-111-1/+4
| | | | | | | | Additional exceptions can be thrown here, ignore additional project lookup exceptions, but still not all. Server failures are still interesting, for example. Change-Id: I9a750ae8e8efa29a36bbd1e34b50b6ace0658260
* Funcional tests: quota listDean Troyer2017-05-021-16/+62
| | | | | | | | | | | | The quota list tests have a race in them where occasionally a project is deleted in another test between the time that quota list gets a list of all projects and it gets the quota for the projects from the service; the get quota call fails on the non-existant project. The quota list functional tests have been substantially re-written to properly test the exception handling. Change-Id: I71e6bbb5d46fcea4718a5a870f9a66a2c20fff0f
* Fix quota functional tests for nova-netDean Troyer2017-04-261-2/+5
| | | | | | | | | We need to skip some functional tests when testing against a nova-net cloud so add the bits to detect that. Also JSON-ify the quota functional tests and add the skips for nova-net. Change-Id: Ibfeeb3f967f34c98e80271a8214cf95dc50407f1
* Improve no-auth pathDean Troyer2017-04-241-1/+14
| | | | | | | | | | | The commands that do not require authentication sometimes still need to call ClientManager.is_network_endpoint_enabled() to see if Neutron is available. Optimize the paths a bit to skip auth when it is not necessary; the upshot is Neutron will be assumed in these cases now. This gets a LOT cleaner when it appears is a future osc-lib. Change-Id: Ifaddc57dfa192bde04d0482e2cdcce111313a22a
* Clean up password prompt work-aroundsDean Troyer2017-04-051-2/+2
| | | | | | osc-lib 1.2 is minimum and now handles the password prompting. Change-Id: Ie11ad64796d3a89c7396b321c34947d622d1ed39
* Merge "OSC Extension Show"Jenkins2017-03-231-0/+29
|\
| * OSC Extension ShowSindhu Devale2017-03-221-0/+29
| | | | | | | | | | | | | | | | Implement Neutron feature of Extension Show into OpenStack Client. Change-Id: Ifecb794838cb3bf8c2466d178345349db3cd4003 Implements: blueprint extension-show
* | Merge "OSC Quota List"Jenkins2017-03-211-0/+173
|\ \
| * | OSC Quota ListSindhu Devale2017-03-101-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | Implement Neutron feature of Quota List into OpenStack Client. Change-Id: Idf941acf8d00b136776b7381b877c56d82622f57 Partially-Implements: blueprint neutron-client-quota
* | | Trivial FixReedip2017-03-051-1/+1
| | | | | | | | | | | | | | | | | | Add a space in the quota error message Change-Id: I159708b42e86f6b02f8733103a687561d550f650
* | | Support list commands by group name keywordRui Chen2017-02-231-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The output of current "command list" is so long, it's very difficult for users to find out the commands they care about. Add "--group <group-keyword>" option to filter the commands by group name keyword, like: --group volume, list all openstack.volume.v2 (cinder) commands That support the scenario that users need to know the current support commands of some OpenStack services(nova, neutron, cinder and so on) in OSC. Change-Id: Id673042729ad36a0cac0b81fb31a3537c24f03fc Closes-Bug: #1666780
* | | Show openstacksdk version info in "module list"Rui Chen2017-02-221-1/+9
|/ / | | | | | | | | | | | | | | | | openstacksdk bug/1588823 exist, no good way to add __version__ for openstack module properly, fix the issue in osc side, make openstacksdk module information be available. Change-Id: I27ff61792443d1aa07f31598bed3aa32f924ff40 Partial-Bug: #1662058
* | Merge "Remove remaining uses of SDK Proxy.session"Jenkins2017-02-211-35/+1
|\ \
| * | Remove remaining uses of SDK Proxy.sessionDean Troyer2017-02-191-35/+1
| | | | | | | | | | | | | | | | | | | | | SDK commit Ie67c240e3caa5e100ce07db3862718195c894748 exposed lingering uses of Proxy.session in OSC. Get rid of them. Change-Id: Icab230f1897a446cf3deb0e3d0550d24e11a0ef3
* | | TODO cleanup: osc-libDean Troyer2017-02-201-68/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osc-lib 1.3.0 is released, which contains these functions that still need to be migrated all the way down to os-client-config. Currently osc-lib 1.2.0 is in global-requirements so this can not be merged yet, but is included here for testing and to be ready for when g-r is unfrozen. Change-Id: I7bc8ed6cf78f38bab4a718ed3e2a88641fa23f27
* | | Remove unused logging importAnh Tran2017-02-201-5/+0
|/ / | | | | | | Change-Id: I9edf4075ffea2e8d42283bd654b74cd4ab4a3638
* | Remove quota set workaround for SDK <0.9.13Dean Troyer2017-02-171-30/+3
| | | | | | | | Change-Id: I89732c49e73ac5a789fdbe19536389f7e93ac0e6
* | Fix "module list --all" failedRui Chen2017-02-061-10/+16
| | | | | | | | | | | | | | | | | | | | KeyError cause the command "module list --all" failed, fix it, and do refactor to filter private modules and reduce the loop times, add related unit tests and functional tests. Change-Id: Icd77739502e05b5f763a04a92547497bf82d5d63 Closes-Bug: #1661814
* | TODO cleanup: OSC_ConfigDean Troyer2017-02-011-34/+0
| | | | | | | | | | | | | | | | os-client-config is now at 1.22.0 in global-requirements, we can remove this pw_func setting block as the pw_func arg to __init__() was added in 1.21.0. Change-Id: I5bbc3e3aae4f3e4c4333c73bba19bda65e0d8488
* | Fix OSC networking commands help errorsRui Chen2017-01-221-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | OSC networking commands need to authenticate to get service catalog, then decide to show nova-network or neutron command help message. Fake token and fake auth_type in prepare_to_run_command() casue os-cloud-config use AdminToken auth plugin, but pass all the auth information (include: username, password and so on) to it, that casue the class initialization error. Pop the fake token and url, then try to load auth plugin again to fix the issue. Change-Id: I8b140f0b0a60681fc2a35a013bb0c84ff8cb9589 Closes-Bug: #1650026
* | Fix quota set command error for SDK > 0.9.10Huanxuan Ao2017-01-151-3/+30
| | | | | | | | | | | | | | | | | | | | A bug in OpenStack SDK 0.9.11 and 0.9.12 that causes quota set command to fail. This can be removed when the proposed SDK fix (https://review.openstack.org/#/c/419911/) is released and in the minimum SDK version in global requirements. Closes-Bug: #1655445 Change-Id: I63132f5f762f0120282f8b92e72512763063e3c6