summaryrefslogtreecommitdiff
path: root/openstackclient/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Drop default from ask_user_yesno question"Zuul2023-02-221-5/+3
|\
| * Drop default from ask_user_yesno questionDr. Jens Harbott2022-12-271-5/+3
| | | | | | | | | | | | | | There is no default for ask_user_yesno() since an empty answer instead just repeats the question. Drop the unnecessary parameter. Change-Id: I207bccbcbd31f831765e74a20c503b695790c0f5
* | Fix really long help stringsStephen Finucane2022-12-121-6/+4
|/ | | | | | | | Each command should have a summary line followed by a longer description, if needed. Some commands were not following this. Fix them. Change-Id: If1ce7654037d192626460f34c069ea0979919b9b Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "quota: Deprecate "force" behavior for network quotas"Zuul2022-11-051-11/+40
|\
| * quota: Deprecate "force" behavior for network quotasStephen Finucane2022-10-111-11/+40
| | | | | | | | | | | | | | | | | | | | | | | | In change Idc1b99492d609eb699d0a6bef6cd760458a774f6, we added a '--check-limit' option to enable "no force" behavior for network quotas. This was already the default for compute quotas. Provide a path for harmonizing the behavior of the two options by instead using a '--no-force' option which will become the eventual default for the network quotas also. Change-Id: I25828a3d68e2e900f498e17a0d01fb70be77548e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "quota: Fix issues with delete quota command"Zuul2022-11-051-3/+3
|\ \
| * | quota: Fix issues with delete quota commandStephen Finucane2022-10-111-3/+3
| |/ | | | | | | | | | | | | | | We were passing a project object rather than just the ID. Also correct a typo in the call to delete network quotas. Change-Id: I2292db7932ec01026f0e54014e3d02218792617a Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "quota: Trivial style fixups"Zuul2022-11-051-38/+40
|\ \ | |/
| * quota: Trivial style fixupsStephen Finucane2022-09-301-38/+40
| | | | | | | | | | Change-Id: I4522b54676033dced2b47477238ceb551e11d04a Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "quota: Deprecate 'quota show --class', 'quota set --class' arguments"Zuul2022-11-051-4/+36
|\ \ | |/
| * quota: Deprecate 'quota show --class', 'quota set --class' argumentsStephen Finucane2022-09-301-4/+36
| | | | | | | | | | | | | | | | | | This doesn't do anything special in nova and cinder and is not supported in neutron. For the 'quota show' command, people should use the '--default' argument instead. Change-Id: I0dd38e5cb252a01d5817ed168be040b21b35e348 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "quota: Allow showing project-specific quotas"Zuul2022-11-051-26/+67
|\ \ | |/
| * quota: Allow showing project-specific quotasStephen Finucane2022-09-301-26/+67
| | | | | | | | | | | | | | | | | | Add '--compute', '--network' and '--volume' options to the 'quota show' command, along with a default '--all' option, allowing us to restrict quotas shown to an individual service. Change-Id: I122b765df01887b8d916ee6567ffb7768fcb4392 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "quota: Add 'quota show --usage' option"Zuul2022-10-121-16/+75
|\ \ | |/
| * quota: Add 'quota show --usage' optionStephen Finucane2022-09-301-16/+75
| | | | | | | | | | | | | | | | | | | | | | Provide an more sane way to get usage information for a particular project's quotas. This requires using the 'Lister' command type since the 'ShowOne' command type only allows for simple key-value pair output. We also add a note indicating that the '<project>' argument is optional. Change-Id: Ic7342cf08f024cc690049414c5eef5b9a7594677 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "quota: Simplify logic used to list, show quotas"Zuul2022-10-121-201/+268
|\ \ | |/
| * quota: Simplify logic used to list, show quotasStephen Finucane2022-09-301-201/+268
| | | | | | | | | | | | | | This is prep work for some changes we're introducing in a later change. Change-Id: I27a59bc1d57e6815fb166fb99ea2af88f08b68a9 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "quota: Add support for detailed volume quotas"Zuul2022-10-071-7/+19
|\ \ | |/
| * quota: Add support for detailed volume quotasStephen Finucane2022-09-301-7/+19
| | | | | | | | | | | | | | | | We were stating that this was not supported. That is not true. Correct the oversight. Change-Id: Ib9d9db641a18e142be0a1eccff783e7cccdf2db5 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "quota: Add 'quota delete' command"Zuul2022-10-071-0/+79
|\ \ | |/
| * quota: Add 'quota delete' commandStephen Finucane2022-09-301-0/+79
| | | | | | | | | | | | | | | | | | We had previously indicated that people use 'quota set' for unsetting a project's quotas, however, there was nothing that actually allowed us to do this. Correct that oversight. Change-Id: I04057e766b8ccf94bf219972249b68dc2bb796d4 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | config: Also mask non-prefix configryanKor2022-08-011-1/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'config show' command will show information about your current configuration. When using a 'cloud.yaml' file and the 'OS_CLOUD' environment variable, the output of this will look like so: $ openstack config show +---------------------------------------------+----------------------------------+ | Field | Value | +---------------------------------------------+----------------------------------+ | additional_user_agent | [('osc-lib', '2.6.0')] | | api_timeout | None | | auth.auth_url | https://example.com:13000 | | auth.password | <redacted> | | auth.project_domain_id | default | | auth.project_id | c73b7097d07c46f78eb4b4dcfbac5ca8 | | auth.project_name | test-project | | auth.user_domain_name | example.com | | auth.username | john-doe | ... All of the 'auth.'-prefixed values are extracted from the corresponding entry in the 'clouds.yaml' file. You'll note that the 'auth.password' value is not shown. Instead, it is masked and replaced with '<redacted>'. However, a 'clouds.yaml' file is not the only way to configure these tools. You can also use old school environment variables. By using an openrc file from Horizon (or the clouds2env tool [1]), we will set various 'OS_'-prefixed environment variables. When you use the 'config show' command with these environment variables set, we will see all of these values appear in the output *without* an 'auth.' prefix. Scanning down we will see the password value is not redacted. $ openstack config show +---------------------------------------------+----------------------------------+ | Field | Value | +---------------------------------------------+----------------------------------+ | additional_user_agent | [('osc-lib', '2.6.0')] | | api_timeout | None | ... | password | secret-password | ... This will also happen if using tokens. This is obviously incorrect. These should be masked also. Make it so. This involves enhancing our fake config generation code to generate config that looks like it came from environment variables. Change-Id: I560b928e5e6bcdcd89c409e0678dfc0d0b056c0e Story: 2008816 Task: 42260
* Merge "Fix typos"Zuul2022-05-162-3/+3
|\
| * Fix typosCyril Roelandt2021-10-262-3/+3
| | | | | | | | Change-Id: Idd502c8df21da79ff3b9339870f38378f5337879
* | Allow "--force" flag in quota network commandsRodolfo Alonso Hernandez2022-03-171-1/+4
| | | | | | | | | | | | | | | | | | This flag allows to set a new Neutron quota resource limit without checking first the current resource usage. The new limit will be set anyway. This flag was used only by the compute engine. Related-Bug: #1953170 Change-Id: I7084f8208b804236ac99e6842db7a45854ce54d7
* | Merge "Add network update quota "limit_check" parameter"Zuul2022-02-031-0/+9
|\ \ | |/ |/|
| * Add network update quota "limit_check" parameterRodolfo Alonso Hernandez2021-12-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | This new parameter commands the Neutron server to first check the resource usage before setting the new quota limit. If the resource usage is below the new limit, the Neutron server will raise an exception. Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/806254 Depends-On: https://review.opendev.org/c/openstack/neutron/+/801470 Partial-Bug: #1936408 Change-Id: Idc1b99492d609eb699d0a6bef6cd760458a774f6
* | Remove 'get_osc_show_columns_for_sdk_resource' duplicatesStephen Finucane2021-10-211-58/+0
|/ | | | | | | | | | | | There were a number of 'get_osc_show_columns_for_sdk_resource' defined in-tree. However, osc-lib has provided this method for some time (since 2.2.0, June 2020 [1] - our minimum version is currently 2.3.0) so there's no need to provide our own copies. Remove them. [1] https://github.com/openstack/osc-lib/commit/29a0c5a5 Change-Id: I25695f4f9a379dd691b7eaa1e3247164668ae77e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Add support for token caching"Zuul2021-04-091-4/+6
|\
| * Add support for token cachingArtem Goncharov2020-12-051-4/+6
| | | | | | | | | | | | | | | | | | | | | | SDK starts caching token in keyring (when available and configured). A small change is required in OSC not to reject this state. Overall this helps avoiding reauthentication upon next openstack call. If token is not valid anymore automatically reauthentication is done. Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/735352 Depends-On: https://review.opendev.org/c/openstack/osc-lib/+/765650 Change-Id: I47261a32bd3b106a589974d3de5bf2a6ebd57263
* | project cleanupArtem Goncharov2021-02-021-0/+140
| | | | | | | | | | | | | | | | | | New implementation of the project cleanup based on the sdk.project_cleanup. It is implemented as an additional OSC operation and will ideally obsolete the `openstack project purge` giving flexibility to extend services support, parallelization, filters, etc. Change-Id: Ie08877f182379f73e5ec5ad4daaf84b3092c829c
* | Add support '--progress' option for 'image create'youngho choi2021-01-041-0/+67
|/ | | | | | | | | | | | | | | | | | | | | | | | | | openstack-client doesn’t support the upload progress bar. This patch shows progressbar when create image if you added '--progress' option like a python-glanceclient. like this. [=============================>] 100% +------------------+---------------------------+ | Field | Value | +------------------+---------------------------+ | container_format | bare | | created_at | 2020-09-06T20:44:40Z | ... How to use Add the'--progress' option on the 'openstack image create' command. Code was written by referring to 'python-glanceclient' project on stable/ussuri branch Change-Id: Ic3035b49da10b6555066eee607a14a5b73797c00 task: 40003 story: 2007777
* Merge "Remove None valued network quota entries"Zuul2020-12-011-4/+9
|\
| * Remove None valued network quota entriesasarfaty2020-09-221-4/+9
| | | | | | | | | | | | | | | | | | | | Since the openstack SDK still has the neutron-lbaas entries in the network quota, but those are already deprecated [1], the 'opentack quota show' command shows those as None value. This fix removes those empty deprecated values from the output. [1] https://review.opendev.org/#/c/658494/ Change-Id: I8dbdba2a029ea8e6a268ddf29627e1466a7e3a8a
* | Remove usage of sixsongwenping2020-10-071-3/+1
|/ | | | | | | | | | | With python3.x, classes can use 'metaclass=' instead of 'six.add_metaclass', 'six.iteritems' and 'six.iterkeys' can be replaced by 'items' and 'keys', 'six.moves.urllib.parse' can be replaced by 'urllib.parse', 'six.StringIO' and 'six.moves.cStringIO' can be replaced by 'io.StringIO', 'six.text_type' and 'six.string_type' are just 'str'. Change-Id: I84848c0bf8ab3c36dd821141191e2725e4e3b58b
* Fix compatibility issue in 5.35.3.1Felix Yan2020-07-141-1/+4
| | | | | | | | | | The offending entry point object looks like: EntryPoint(name='compute', value='openstackclient.compute.client', group='openstack.cli.base') Story: 2007917 Task: 40323 Change-Id: I0f3cc62e23efdc14203ce6645581d5ba5dbf7fa0
* Merge "switch to stevedore for entry points"Zuul2020-07-071-7/+16
|\
| * switch to stevedore for entry pointsDoug Hellmann2020-07-061-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Importing pkg_resources scans every installed distribution to find all of the entry points. Stevedore is adding a new caching layer using importlib.metadata, which will not. Switching to the stevedore should eventually speed up load times, especially for command line apps. This change makes the switch now to ensure API compatibility. We were already using stevedore for tests, so this moves the dependency from test-requirements.txt to requirements.txt and raises the minimum version to something more recent. Change-Id: I3e3632783bc745979b6db73e610df8a77ffaceb0 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
* | Merge "Add '--force; parameter to 'openstack quota set'"Zuul2020-07-061-0/+8
|\ \ | |/ |/|
| * Add '--force; parameter to 'openstack quota set'hackertron2020-04-141-0/+8
| | | | | | | | | | | | | | | | | | The compute service allows us to to force set a quota, setting a quota value that is less than the amount of the resource currently consumed. Expose this feature by way of a '--force' boolean parameter. Change-Id: I1d1ac1ac46f49f64794ffc8631e166935537966c
* | Merge "Allow os quota list query to filter by project"Zuul2020-06-291-2/+11
|\ \
| * | Allow os quota list query to filter by projectJose Castro Leon2020-03-121-2/+11
| |/ | | | | | | | | | | | | | | | | | | In the os quota list command, project parameter is completely ignored ending up in a request to all projects and then all quotas. This patch enables back the parameter and does a single call to quotas if specified. Change-Id: Ie17c256e2bdc307dcd94ad5be7abdbffa776d369 Story: 2007422 Task: 39043
* | 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>