summaryrefslogtreecommitdiff
path: root/openstackclient
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Bypass user and group verification in RemoveRole" into stable/traintrain-em4.0.2Zuul2020-12-022-32/+278
|\
| * Bypass user and group verification in RemoveRoleLance Bragstad2020-08-192-32/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keystone let's users remove role assignments that reference non-existent users and groups. This is nice when keystone backs to an identity store like LDAP and users or groups are removed. Previously, openstackclient would validate the user and group existed in keystone before sending the request to delete the role assignment. This commit updates the code to bypass that validation so that users can use IDs to forcibly cleanup role assignments. Change-Id: I102b41677736bbe37a82abaa3c5b3e1faf2475d5 Story: 2006635 Task: 36848 (cherry picked from commit e24673267093de85beee753860cda1fb224ce4bc)
* | Merge "Add system role assignment tests for users and groups" into stable/trainZuul2020-12-021-0/+137
|\ \ | |/
| * Add system role assignment tests for users and groupsLance Bragstad2020-08-191-0/+137
| | | | | | | | | | | | | | | | | | I was writing some additional functionality and noticed these tests were missing. This commit adds tests for adding and removing system role assignments for users and groups. Change-Id: I30fdc6ec55e1eb1cfa55f4cbf92c3f001d89865f (cherry picked from commit a8aad9fec80bcb6c9917d2dd076373f06467849f)
* | Merge "Add API check for server_groups.list" into stable/trainZuul2020-11-023-4/+136
|\ \
| * | Add API check for server_groups.listLewis Denny2020-10-143-4/+138
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The policies parameter has been replaced with the policy parameter since Nova API version 2.64[1] This commit adds a check to make sure the correct parameter is used. [1]https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id59 Change-Id: Ia37beb7790884d6d15bec45074f446e64af1a2aa Story: #2008041 Task: #40703 (cherry picked from commit ed6d8d941104c60f447de852582eb9388b9d2e73) (cherry picked from commit e7ba80d2097345b730d080ab8b020f1c04fb77d8)
* | Add API check for server_groups.createLewis2020-10-142-2/+30
|/ | | | | | | | | | | | | | | The policies field has been replaced with the policy field since Nova API version 2.64[1] This commit adds a check to make sure the correct field is used. [1]https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id59 Change-Id: I06d3211937d822c26070b7f8ad757c365dcbb1bb Story: #2007822 Task: #40101 (cherry picked from commit 51a1ea65f4d095b073381200e5268f909bf360de) (cherry picked from commit 441f116b0c9e8d0b7e916b3c026f8a2244b4edc7)
* Client should parse string to boolean for value 'is_domain'4.0.1yanpuqing2020-06-102-0/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we use "--property" parameter, client get lists these the value is string type, but the type of the value 'is_domain' should be boolean, so we should judge it and parse it. The patch parse string to boolean for value 'is_domain'. Co-Authored-By: Lance Bragstad <lbragstad@gmail.com> Conflict: Direct backports of this patch fail because the original tests proposed to the Victoria (master) branch included keystone ``options``. Support for ``options`` was added in: I9c3bdd741f28bf558267fb217818d947597ce13e This backport removes the ``options`` key from the expected values in the tests since feature support for ``options`` isn't going to be backported. Otherwise, the functionality of this change is fully tested like it is on later releases. Change-Id: I37c9eb854524bde3a1530bfe2e3a03810fb1a676 Task: 30039 Story: 2005246 (cherry picked from commit 533af9f1b2de40d98f69e83cdf89ecf254cf3879) (cherry picked from commit 19723aee18e2901e9250dd840a61359704baa170)
* Resolve PEP8Pete Zaitcev2020-06-012-2/+1
| | | | | | | | | | No idea how this happened, but reviews started failing the pep8 gate job. The failures are legitimate, see the commit. I guess the pep8 tests became smarter and found these issues. Change-Id: Id9a0dad644134dafd68eed37fe8f41c583d7a619 (cherry picked from commit 52ff421e3d339f81c2625bff429e6829a2d9af67) (cherry picked from commit 37e2c536e4e0b59ec8cb3edd165a0c76d7d8800c)
* Fix router create/show if extraroute not supportedÉdouard Thuleau2020-03-182-1/+19
| | | | | | | | If neutron does not support extraroute l3 extension, the route column formatter fails. Change-Id: I7b89c4f818865073947e0850e86c18d0d2415a51 (cherry picked from commit 509ca3ed36b4ef512a47ff8d39c9df751084015a)
* Merge "Fix openstack server list --deleted --marker option" into stable/trainZuul2020-03-022-3/+55
|\
| * Fix openstack server list --deleted --marker optionKeithMnemonic2020-01-072-3/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes using the "name" option for a marker when --deleted is also used. The find_resource() function that is being called does not correctly handle using the marker as the "name" in the search when also using deleted=True. One simple way to fix this is force the marker to only be an ID when --deleted is used. This is how the nova client works. Using the --deleted option is available to users with the admin role by default. If you're an admin listing --deleted servers with a marker by name, find_resource() is going to fail to find it since it doesn't apply the --deleted filter to find_resource(). The find_resource() function is trying to find the marker server by name if it's not found by id, and to find it by name it's listing servers with the given marker as the name, but not applying the --deleted filter so it doesn't get back any results. In the story it was suggested modifying find_resource to include the deleted query param when it's specified on the command line but that didn't work because it still results in something like this: http://192.168.1.123/compute/v2.1/servers?deleted=True&name=4cecd49f-bc25-4a7e-826e-4aea6f9267d9 It seems like there are bugs in find_resource(). Restricting the marker to be the server ID when listing deleted servers is probably OK since if you're using --deleted you're an admin and you could be listing across all projects and if you're filtering by a server across all projects anyway (not that you have to, I'm just saying if you are), or even showing a server in another project, you have to do it by id rather than name because find_resource() won't find the server in another project by name, only ID. story: 2006761 Task: 37258 Change-Id: Ib878982b1d469212ca3483dcfaf407a8e1d2b417 (cherry picked from commit f5384ae16a24cdd54149fa21827d14b8b8983d4f)
* | Stop silently ignoring invalid 'server create --hint' optionsStephen Finucane2020-02-042-12/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The '--hint' option for 'server create' expects a key-value pair like so: openstack server create --hint group=245e1dfe-2d0e-4139-80a9-fce124948896 ... However, the command doesn't complain if this isn't the case, meaning typos like the below aren't indicated to the user: openstack server create --hint 245e1dfe-2d0e-4139-80a9-fce124948896 Due to how we'd implemented this here, this ultimately results in us POSTing the following as part of the body to 'os-servers': { ... "OS-SCH-HNT:scheduler_hints": { "245e1dfe-2d0e-4139-80a9-fce124948896": null } ... } Which is unfortunately allowed and ignored by nova due to the use of 'additionalProperties' in the schema [1] Do what we do for loads of other options and explicitly fail on invalid values. This involves adding a new argparse action since none of those defined in osc-lib work for us. This is included here to ease backporting of the fix but will be moved to osc-lib in a future patch. [1] https://github.com/openstack/nova/blob/19.0.0/nova/api/openstack/compute/schemas/servers.py#L142-L146 Change-Id: I9e96d2978912c8dfeadae4a782c481a17cd7e348 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: #2006628 Task: #36840 Related-Bug: #1845322 (cherry picked from commit ea27ebb0f918db9eab2f5751a1b065818faa0e6d)
* | Fix functional tests for py3Eric Fried2020-01-065-7/+8
|/ | | | | | | | | | | | | | | | | Fix various things so the functional tests will work under python3: - A hashlib.md5() can only be update()d with an encoded string in py3. - There's no dict.iteritems(), change to dict.items() (which is already an iterator). - Open temp files with 'w+' mode rather than the default 'w+b' (as an alternative to encoding all the write and expected-read payloads as bytes). - (This is a weird one) Explicitly raise SkipTest from unittest (rather than unittest2, which is where cls.skipException landed). Not sure why this is busted, but this moves the ball. Change-Id: Ic9b2b47848a600e87a3674289ae7ae8c3e091fee (cherry picked from commit f1d742f32adeb662a3fdf8fa3ef3bc391e71ed81)
* Merge "Clean up app initialization and config"Zuul2019-09-112-103/+1
|\
| * Clean up app initialization and configDean Troyer2019-09-092-103/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | Merge "More aggregate functional race chasing"Zuul2019-09-111-5/+3
|\ \
| * | More aggregate functional race chasingDean Troyer2019-09-101-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | AggregateTests.wait_for_status() was a classmethod, those often are sources of conflict in parallel testing... Change-Id: I6211fd9c36926ca97de51a11923933d4d9d2dfda Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* | | Merge "Default to Cinder v3 API"Zuul2019-09-101-1/+1
|\ \ \
| * | | Default to Cinder v3 APISean McGinnis2019-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches the default Cinder API version to v3 to prepare for v2 going away. Change-Id: Icca1512b715409e3001c0fd2d1ea663d5e71ec02 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | | | Merge "Add floating IP Port Forwarding commands"Zuul2019-09-093-0/+950
|\ \ \ \ | |_|/ / |/| | |
| * | | Add floating IP Port Forwarding commandsLIU Yulong2019-08-293-0/+950
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add following commands: floating ip port forwarding create floating ip port forwarding delete floating ip port forwarding list floating ip port forwarding set floating ip port forwarding show Closes-Bug: #1811352 Change-Id: I6a5642e8acce28fc830410d4fa3180597b862761
* | | | Merge "Format location columns in network commands"Zuul2019-09-0922-28/+119
|\ \ \ \ | |_|_|/ |/| | |
| * | | Format location columns in network commandsDean Troyer2019-08-3022-28/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These return a Munch from the SDK, which can be handled exactly like a dict so do that. Note that the location column has a nested project dict in the return value, this is addressed separately in osc_lib.format_columns in https://review.opendev.org/#/c/679474/. Change-Id: I99a6d192749a4ac76777f72be8118261c0521cb0 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* | | | Microversion 2.77: Support Specifying AZ to unshelvezhangbailin2019-09-032-4/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new parameter ``--availability-zone`` to ``openstack server unshelve`` command. This can help users to specify an ``availability_zone`` to unshelve a shelve offloaded server from 2.77 microversion. Depends-On: https://review.opendev.org/679295 Implements: blueprint support-specifying-az-when-restore-shelved-server Change-Id: Ia431e27c2a17fe16466707cc362532860ecf22df
* | | | Remove races in floating ip functional testsDean Troyer2019-08-311-53/+67
|/ / / | | | | | | | | | | | | | | | | | | | | | Multiple subnets with the same name are occasionally created when running tests in parallel. Change-Id: Ifb85e39ee53b529e2b97abf782c7fba93d48e9e2 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* | | Merge "Remove token_endpoint auth type"Zuul2019-08-295-93/+32
|\ \ \
| * | | Remove token_endpoint auth typeDean Troyer2019-08-275-93/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The token_endpoint was a compatibility auth type to maintain support for the --url global option that dated back to the beginning of OpenStack CLI auth. The common keystoneauth library implements 'admin_token' which provides the same functionality using --endpoint rather than --url. Change-Id: I1b9fbb96e447889a41b705324725a2ffc8ecfd9f Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* | | | Merge "Bump hacking version"Zuul2019-08-286-33/+34
|\ \ \ \ | |_|/ / |/| | |
| * | | Bump hacking versionStephen Finucane2019-08-277-34/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pick up newer versions of this library. Thankfully no serious changes are needed. Change-Id: I69e523844529fc1c8aa0c1ce764182dbe29cfeb6 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "Format aggregate command fields and de-race functional tests"Zuul2019-08-273-29/+117
|\ \ \ \ | |_|/ / |/| | |
| * | | Format aggregate command fields and de-race functional testsDean Troyer2019-08-263-29/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename metadata to property in all aggregate commands Beef up functional tests to reduce street racing Change-Id: I4598da73b85a954f3e6a3981db21891b45d9548c Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* | | | Merge "Add CLI argument tests before making changes"Zuul2019-08-271-0/+79
|\ \ \ \ | |/ / / |/| | |
| * | | Add CLI argument tests before making changesDean Troyer2019-08-221-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add these tests before hacking on the global args and removing the compatibility stuff so we can clearly see what actually changes. Change-Id: Ic86c89da1475b4914ff7cb2396199cd219a12097 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* | | | Merge "Fix functional.base.TestCase.openstack() to optionally omit ↵Zuul2019-08-231-5/+19
|\ \ \ \ | |/ / / | | | | | | | | --os-auth-type"
| * | | Fix functional.base.TestCase.openstack() to optionally omit --os-auth-typeDean Troyer2019-08-221-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the functional test TestCase.openstack() method to add a way to not include the --os-auth-type option in order to test the default auth-type logic. Change-Id: I0f1ca2f7517a41278afaad5aaf4e98accb16bea2 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* | | | Merge "Document 2.53 behavior for compute service list/delete"Zuul2019-08-221-2/+9
|\ \ \ \ | |/ / / |/| | |
| * | | Document 2.53 behavior for compute service list/deleteMatt Riedemann2019-08-201-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With compute API microversion 2.53, nova-compute services can only be deleted with the ID as a UUID to uniquely identify the service in a multi-cell deployment. This documents that for the "compute service delete <service>" argument. The description of the "compute service list" command is also updated to mention that the ID can be retrieved as a UUID using 2.53 or greater. Change-Id: If7d4a27c0aaef588bcd77dd9edddec1e535fbf31 Story: 2005349 Task: 30302
* | | | Merge "Add 'openstack server resize (confirm|revert)' commands"Zuul2019-08-202-2/+135
|\ \ \ \
| * | | | Add 'openstack server resize (confirm|revert)' commandsStephen Finucane2019-08-092-2/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are currently exposed as flags on the 'openstack server resize' command but they are in fact operation and should be exposed as commands in their own right. The old flag-based variants are deprecated for removal in 4.0. Change-Id: I733796d3bda6c3755a3d3548bbe695abb474a6a0 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | Merge "Add openstack server create --boot-from-volume option"Zuul2019-08-203-2/+134
|\ \ \ \ \ | | |_|/ / | |/| | |
| * | | | Add openstack server create --boot-from-volume optionMatt Riedemann2019-08-093-2/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a --boot-from-volume option to the server create command which is used with the --image or --image-property option and will create a volume-backed server from the specified image with the specified size. Similar to the --volume option, the created root volume will not be deleted when the server is deleted. The --boot-from-volume option is not allowed with the --volume option since they both create a block device mapping with boot_index=0. Change-Id: I88c590361cb232c1df7b5bb010dcea307080d34c Story: 2006302 Task: 36017
* | | | | Merge "Fix <id> description for --block-device-mapping"Zuul2019-08-201-2/+1
|\ \ \ \ \ | |/ / / /
| * | | | Fix <id> description for --block-device-mappingMatt Riedemann2019-08-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The <id> portion of a --block-device-mapping value can be the resource name or id since the code uses the appropriate type-specific find_resource utility to lookup the resource based on the value given. This change simply fixes the description of <id> to mention it's name or id rather than just "UUID". My guess is the description was originally copied from novaclient where id must be an id since name resolution does not happen in novaclient. Change-Id: I567f6f6efb3a3b6d387133d21aa81354b2d753bc
* | | | | Merge "Support type=image with --block-device-mapping option"Zuul2019-08-202-6/+111
|\ \ \ \ \ | |/ / / /
| * | | | Support type=image with --block-device-mapping optionMatt Riedemann2019-08-092-6/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --block-device-mapping option on the server create command currently only supports booting from volume and volume snapshot. A common boot-from-volume scenario is providing an image and letting nova orchestrate the creation of the image-backed volume and attaching it to the server. This adds support for type=image in the --block-device-mapping option. The volume size is required in this case. Note that the CLI currently says if type=snapshot that size is also required but that's technically not true. When booting from a volume snapshot, the compute API will use the size of the volume snapshot to create the volume if an explicit size is not provided. For the purposes of this patch, we need the size anyway for the image being the block device mapping source type. Change-Id: I57b3c261d8309f7b9f62a3e91612bce592a887a3 Story: 2006302 Task: 36016
* | | | | Merge "Fix compute service set handling for 2.53+"Zuul2019-08-202-11/+156
|\ \ \ \ \ | | |_|/ / | |/| | / | |_|_|/ |/| | |
| * | | Fix compute service set handling for 2.53+Matt Riedemann2019-08-092-11/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With compute API microversion 2.53 there is a single PUT /os-services/{service_id} API which takes the service id as a UUID. Since the openstack compute service set command only takes --host and --service (binary) to identify the service, this change checks if 2.53 or greater is being used and if so, looks up the service by host and binary and calls the appropriate methods in novaclient. If the command cannot uniquely identify a compute service with the given host and binary, an error is raised. A future change could add an --id option to be used with 2.53+ to pass the service id (as UUID) directly to avoid the host/binary filtering. Change-Id: I868e0868e8eb17e7e34eef3d2d58dceedd29c2b0 Story: 2005349 Task: 30302
* | | | Merge "Make configuration show not require auth"Zuul2019-08-095-54/+144
|\ \ \ \
| * | | | Make configuration show not require authDean Troyer2019-08-015-54/+144
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>