summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* Handle multiple ports in AddFloatingIP3.16.2melanie witt2018-11-081-8/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AddFloatingIP refers to an old nova proxy API to neutron that was deprecated in nova. The neutron API for floating IP associate requires a port to be specified. Currently, the code is selecting the first port if the server has multiple ports. But, an attempt to associate the first port with a floating IP can fail if the first port is not on a network that is attached to an external gateway. In order to make the command work better for users who have a server with multiple ports, we can: 1. Select the port corresponding to the fixed_ip_address, if one was specified 2. Try to associate the floating IP with each port until one of the attempts succeeds, else re-raise the last exception. (404 ExternalGatewayForFloatingIPNotFound from neutron) This also fixes incorrect FakeFloatingIP attributes that were being set in the TestServerAddFloatingIPNetwork unit tests, which were causing the tests to use None as parsed args for ip-address and --fixed-ip-address and thus bypassing code in the 'if parsed_args.fixed_ip_address:' block. Task: 27800 Story: 2004263 Change-Id: I11fbcebf6b00f12a030b000c84dcf1d6b5e86250 (cherry picked from commit 013c9a4f3a44cb0b81fc7affe9b933e701cb5dba)
* Merge "Default --nic to 'auto' if creating a server with >= 2.37" into ↵Zuul2018-11-022-0/+52
|\ | | | | | | stable/rocky
| * Default --nic to 'auto' if creating a server with >= 2.37Matt Riedemann2018-10-252-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compute API version >= 2.37 requires a 'networks' value in the server create request. The novaclient CLI defaults this to 'auto' if not specified, but the novaclient ServerManager.create python API binding code does not, as it wants clients to be explicit. For the purposes of the OSC CLI, we should follow suit and if the user is requesting OS_COMPUTE_API_VERSION>=2.37 without specific nics, we should just default to 'auto'. Change-Id: Ib760c55e31209223338a4086ff1f4fee88dc6959 Closes-Bug: #1750395 (cherry picked from commit 1008544882fbdae16b045abca05cf3e2e8a14787)
* | Allow endpoint filtering on both project and project-domainJulie Pichon2018-10-151-0/+41
|/ | | | | | | | | | | | The --project and --project-domain flags are currently mutually exclusive for listing endpoints, however the --project-domain argument is supposed to help with filtering projects with colliding names. They should be allowed together. Story: 2004018 Task: 27004 Change-Id: I7340e01f509e3515f07cb46f175fb603f1ce8b67 (cherry picked from commit 91a2d888625488da3f65ad372b4248e9747b9a3e)
* Fix 'project purge' deleting wrong project's servers and volumesJulie Pichon2018-09-171-12/+18
| | | | | | | | | | | | | | | 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: 26494 (cherry picked from commit 1b66ad9067cc404ebfdc8569822d226d5bffddd6)
* Fix broken gate jobs3.16.1Fan Zhang2018-09-031-47/+0
| | | | | | | | | | | | | | | | | | | | | | | | This patch aims at fixing the broken gate jobs because of cinder and glance patches [1], [2], [3] and [4]. * Remove parameter `--source-replicated` to drop volume replication v1 support * Address some timing issues with volume transfer requests * Only run Image v1 tests when the test cloud has v1 available * Get tolerant of unexpected additional attributes being returned in Image data [1].https://review.openstack.org/#/c/586293/ [2].https://review.openstack.org/#/c/532503/ [3].https://review.openstack.org/#/c/533564/ [4].https://review.openstack.org/#/c/578755/ Co-Authored-By: Dean Troyer <dtroyer@gmail.com> Co-Authored-By: Monty Taylor <mordred@inaugust.com> Depends-on: https://review.openstack.org/588664 Change-Id: I2a785750e92155185d3344e6116c7f5c6fdd3cbe Signed-off-by: Fan Zhang <zh.f@outlook.com> (cherry picked from commit def83a0e94de2f98e3bd68ee412c0f0a2c316f32)
* Merge "Don't sent disk_over_commit if nova api > 2.24"Zuul2018-07-251-0/+35
|\
| * Don't sent disk_over_commit if nova api > 2.24Artom Lifshitz2018-07-241-0/+35
| | | | | | | | | | | | | | | | | | | | In API microversion 2.25 Nova removed the disk_over_commit parameter to the live migration server action. This patch makes sure that we don't include it in our request if we're running with 2.25 or higher. Story: #2002963 Task: #22966 Change-Id: I1bbdd33be96d82422a05982508e370237c3560f3
* | Merge "Support --community in openstack image list"Zuul2018-07-251-0/+29
|\ \
| * | Support --community in openstack image listNobuto Murata2018-07-241-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | "--community" was added to "image create" and "image set" previously, but was missed in "image list". Change-Id: I959fdd7f67ae62c8326659ce52389228152ec019 Story: 2001925 Task: 14453
* | | Merge "Implement support for project limits"Zuul2018-07-252-0/+407
|\ \ \
| * | | Implement support for project limitsLance Bragstad2018-07-232-0/+407
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit let's users manage limits via the command line. bp unified-limits Change-Id: I7c44bbb60557378b66c5c43a7ba917f40dc2b633
* | | | Merge "Implement support for registered limits"Zuul2018-07-252-0/+533
|\ \ \ \ | |/ / /
| * | | Implement support for registered limitsLance Bragstad2018-07-232-0/+533
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for users to manage registered limits via the command line. bp unified-limits Depends-On: https://review.openstack.org/#/c/574391/ Change-Id: Id8377363f7a3248b45aeeba21d2acc02684a0305
* | | | Merge "compute: host: expand kwargs in host_set() call"Zuul2018-07-251-4/+3
|\ \ \ \
| * | | | compute: host: expand kwargs in host_set() callBenoît Knecht2018-07-201-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `host_set()` expects `status` and `maintenance_mode` as keyword arguments, but in `SetHost.take_action()`, it is called without expanding the keyword arguments. So it's called as ``` host_set(host, {'status': 'enable'}) ``` instead of ``` host_set(host, status='enable') ``` Change-Id: If0b37ac60091161a892bfc694fce31a988f66005 Task: 23023
* | | | | Merge "Support filtering port with IP address substring"Zuul2018-07-251-0/+18
|\ \ \ \ \
| * | | | | Support filtering port with IP address substringHongbin Lu2018-06-291-0/+18
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | Change-Id: I9559f1c0a6db943705bd32aefb60d7ea7054dd1b Related-Bug: #1718605
* | | | | Merge "Fix error with image show when image name is None"Zuul2018-07-241-1/+2
|\ \ \ \ \ | |_|_|_|/ |/| | | |
| * | | | Fix error with image show when image name is NoneJake Yip2018-07-231-1/+2
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Need to bump osc-lib to 1.10.0 Closes-Bug: #1736696 Depends-On: I2aab5cc1f550848bda2b90ef7ef9a60f07b88996 Change-Id: I7420204f28d36529354e5671bd88587d9b15bb06
* | | | Merge "Do not require port argument when updating floating IP"Zuul2018-07-241-6/+51
|\ \ \ \
| * | | | Do not require port argument when updating floating IPyanpuqing2018-06-131-6/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setting floating ip other properties, port argument is force to use. The patch modifies the command, when setting floating ip other properties, like tags, no need port argument. Change-Id: I908712c8913f32d3dd5fdfefe7347277d72f66de Story: 1751431 Task: 13865
* | | | | Pass volume snapshot size to volume createMonty Taylor2018-07-231-1/+1
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a volume from a snapshot, the size parameter is required and type is checked. Since we have to pass something and it needs to be a valid data type (None is not acceptable) grab the size from the snapshot object and pass it. Change-Id: Ie23e3d23828919234e40336b5c65b22e140d337c
* | | | Skip calls to glance and nova when got no serversPavlo Shchelokovskyy2018-07-091-0/+19
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | save (potentially many) HTTP calls to Glance API for image list and a call to Nova API for flavor list when the server list actually returned no servers. Change-Id: I93a56138c50b82fb4dce67a2f788107f71c5f423 Story: #2002039 Task: #19681
* | | Merge "Adding api_version to FakeApp"Zuul2018-06-291-0/+1
|\ \ \
| * | | Adding api_version to FakeAppTelles Nobrega2018-06-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to use app.api_version['<some_service>'] we need to have the api_version on FakeApp otherwise the test will fail. Patch that will benefit from this: https://review.openstack.org/#/c/572536/ Change-Id: Ibb3c548daf2a62b6c4aefb5e257372dd5c56521e
* | | | Merge "Add ability to filter image list by tag"Zuul2018-06-291-0/+14
|\ \ \ \ | |_|_|/ |/| | |
| * | | Add ability to filter image list by tagAdam Harwell2018-06-281-0/+14
| | | | | | | | | | | | | | | | Change-Id: I2e222d3e69df9d8d7cd472663caaee31bedd848c
* | | | Merge "Compute: Add description support for flavor"Zuul2018-06-282-3/+134
|\ \ \ \
| * | | | Compute: Add description support for flavortianhui2018-06-202-3/+134
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | Co-Authored-By: Fan Zhang <zh.f@outlook.com> Change-Id: I0dc80bee3ba6ff4ec8cc3fc113b6de7807e0bf2a Story: 2002196 Task: 21681
* | | | Merge "Network: Add tag support for security group"Zuul2018-06-252-4/+171
|\ \ \ \
| * | | | Network: Add tag support for security groupDongcan Ye2018-06-142-4/+171
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Icccb23429913724c6a8bd15d4737672b47a5f13a Closes-Bug: #1750983
* | | | | Merge "compute: limit the service's force down command above 2.10"Zuul2018-06-241-1/+9
|\ \ \ \ \
| * | | | | compute: limit the service's force down command above 2.10He Jie Xu2018-06-191-1/+9
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | The force down action is added in Microversion 2.11, we should limit the command only can be executed when the microversion is above 2.10. Change-Id: I0a87e02e71ff025d30181fc17ebcd003a590f110
* | | | | Merge "Fix subnet host_routes error"Zuul2018-06-241-0/+30
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Fix subnet host_routes errorHuang Cheng2018-06-141-0/+30
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | When updating subnet with "no-host-route" option, set host_routes to an empty list as neutron_lib.api.validators expected. Change-Id: I6fe039793d813758429c7a104fd40172b4f8122b Closes-Bug: #1747101
* | | | Fix the `role implies list` command.Sami MAKKI2018-06-242-12/+22
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was calling an unexisting function which never existed. The module refers now to the correct `InferenceRuleManager`. It also allows the compatibility with the future python-keystoneclient in which the compatibility method will be removed from the RoleManager. Change-Id: I08f785dc9e840da2e16915683eecfe49189c44b3
* | | Merge "Fix server show for microversion 2.47"Zuul2018-06-121-0/+27
|\ \ \
| * | | Fix server show for microversion 2.47Matt Riedemann2018-06-081-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compute API version 2.47 embeds the server's internal flavor in the response. The original flavor id is not preserved since it could have changed if the flavor was deleted and re-created after the server was created, which was the dreaded Horizon "Edit Flavor" issue. So the flavor dict in the server response is a dict of information about the flavor representing the server "right now" excluding the id. The original flavor name is shown though along with the ram/disk/vcpu etc information. The server list command has a similar issue which will be fixed in a follow up change. Change-Id: I1a92999758006d02567c542b6be8902a049899cc Task: 13864 Story: 1751104
* | | | Merge "Optimize _prep_server_detail to avoid redundant find_resource"Zuul2018-06-121-4/+4
|\ \ \ \ | |/ / /
| * | | Optimize _prep_server_detail to avoid redundant find_resourceMatt Riedemann2018-06-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When showing a server or doing a rebuild, we already have the latest version of the server so _prep_server_detail getting the server again is an unnecessary performance hit. ShowServer is pretty obvious here. For RebuildServer, the compute API actually refreshes the server before returning it in the response, so the client already gets the latest when the rebuild call returns. The only other usage of _prep_server_detail that does require a refresh is CreateServer since the POST /servers response is a minimal version of the server object. This adds a new refresh kwarg, backward compatible by default, to _prep_server_detail but changes ShowServer and RebuildServer to no longer refresh. Change-Id: Ib1c9c424ed1cafc2dfd8be90af8de8a774bdfbf0
* | | | Merge "Add system role functionality"Zuul2018-06-091-1/+41
|\ \ \ \ | |/ / / |/| | |
| * | | Add system role functionalityLance Bragstad2018-06-041-1/+41
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the necessary bits to expose system role assignments to openstackclient via python-keystoneclient. bp system-scope Depends-On: Iecbcbf020a15f2bec777334c648d4477f89f3b2c Change-Id: I261e84700b51e8715eaebdc3f8f8bc46b68542c2
* | | Allow setting network-segment on subnet updateHarald Jensas2018-06-061-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | To enable the possibility to migrate a non-routed network to a routed network allow updating the segment_id of a subnet. Change-Id: I3ebae2ff28d5d4e5373ebd1f52194f8c52071b88 Partial-Bug: bug/1692490 Depends-On: I1aee29dfb59e9769ec0f1cb1f5d2933bc5dc0dc5
* | | Make max_burst_kbps option as optional for bw limit QoS ruleSławek Kapłoński2018-05-251-6/+49
|/ / | | | | | | | | | | | | | | | | | | Attribute max_burst_kbps of QoS bandwidth limit rule in Neutron's is optional in API so it should be also optional on client's side. Change-Id: Ie085b73fa885ff12f9ac080666cf3ca6a09b632a Related-Bug:#1770622 Task: 19658 Story: 2002017
* | Merge "Fix limits show command without Nova and Cinder"Zuul2018-04-234-0/+343
|\ \
| * | Fix limits show command without Nova and CinderJude Cross2018-04-034-0/+343
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Network: Add tag support for floating ip"Zuul2018-04-232-3/+134
|\ \ \
| * | | Network: Add tag support for floating ipDongcan Ye2018-04-172-3/+134
| | |/ | |/| | | | | | | | | | Change-Id: I7a500a4ff6cec2442b4050df26c0b017d9f71903 Closes-Bug: #1750985
* | | Merge "Add support to list image members"Zuul2018-04-021-0/+46
|\ \ \