summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/compute
Commit message (Collapse)AuthorAgeFilesLines
* [Compute]Make column content readable for both human and machineRui Chen2017-09-184-63/+84
| | | | | | | | | | | | | | | | Currently, we use utils.format_dict(), utils.format_list(), utils.format_list_of_dicts to make column value can be easy to read by human, but osc support to format the CLI output into several format, like: json, shell, csv, yaml, most of these should be understand by program and code, so keeping the column content as the original value make sense, like {u'name': u'RuiChen'} than name='RuiChen' The patch include all compute commands. Change-Id: I313a52f94895625e6045df870320840fee157759 Implements: blueprint osc-formattable-columns Partial-Bug: #1538015 Partial-Bug: #1538006
* Merge remote-tracking branch 'origin/master' into f4-merge-branchDean Troyer2017-09-144-4/+6
|\ | | | | | | Change-Id: Ie6c321e67aa9338334e4649879e60847a5d1eb56
| * Use flake8-import-order pluginAkihiro Motoki2017-08-174-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Use cliff formattable columns in image commandsAkihiro Motoki2017-08-162-8/+10
|/ | | | | | | | | Related functional tests are converted into JSON format. Otherwise, it is not easy to check results. Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: I682e67be24372c0de145f8db20911b13530ae6c6
* Merge "Now OSC server create check keys in --nic"Jenkins2017-07-201-0/+60
|\
| * Now OSC server create check keys in --nicM V P Nitesh2017-06-231-0/+60
| | | | | | | | | | | | | | | | Now OSC command to create server will check all the keys in --nic and throws an exception if the key is invalid key. Change-Id: I5482da0ae63d6d4298aa614e4d09bb0547da9ec3 Closes-Bug: #1681411
* | Fix column names for server list --no-name-lookupDean Troyer2017-07-171-11/+6
| | | | | | | | | | | | | | | | When --long is not present change the 'Image Name' column to 'Image' and add the 'Flavor' column. These columns will contain Names unless --no-name-lookup is specified when they will contain IDs. Change-Id: I92cfb22136aee32616894e60e9227b4da185da99
* | Add server list -n and --no-name-lookup argumentsBoris Pavlovic2017-07-101-0/+50
|/ | | | | | | | | | | | | | Remove translation of Image ID and Flavor ID to Image and Flavor names In large environments amount of images can be very large (thousands) Which requires ~hundreds of requests to Glance to get all images (by default client request only 20 images) As a result listing even few servers is going to take minutes This patch allows to avoid these queries by not doing translation, which allows one to get information about servers in seconds. Change-Id: I4ae00e6324a41c4c79bf5b620179dae99aea5431
* Trivial fix typosVu Cong Tuan2017-05-301-2/+2
| | | | Change-Id: I72a1da209df38e226ec02d9dbd0142ed4020c0d2
* Merge "Create server with security group ID and name"Jenkins2017-05-221-1/+96
|\
| * Create server with security group ID and nameRui Chen2017-05-221-1/+96
| | | | | | | | | | | | | | | | | | | | | | Both resource ID and name are supported to identify an object in openstackclient to make user easy to input, for security group, nova only support security group name in API when launch a new server, this patch convert ID to name, then pass name to nova API, and check the security group exist before creating server. Change-Id: I1ed4a967fb9de3f91c8945a1ef63f6c7b6b2dfb2 Closes-Bug: #1687814
* | Make block-device-mapping more stable and clearRui Chen2017-05-171-10/+329
|/ | | | | | | | | | | | | | | | | | | | | | The patch fix the following issues: 1. ValueError is raised if input don't contain "=". Sometimes the whole "server create" command is very complex, it's difficult to find out root reason directly. 2. Don't support to add block device from snapshot, like: --block-device-mapping vdb=0c8ae9d8-cadc-4a23-8337-4254614d277e:snapshot:1, it's supported by novaclient, but not in osc. 3. If input "vdb=", not add any mapping information, the server will be launched successfully, not raise error message to let use add volume/snapshot id, just ignore "--block-device-mapping" option. 4. The help message of "block-device-mapping" option is so simple, need to add some details about how to add <type>, <delete_on_terminate> contains. Change-Id: Ib7f7a654c3dc2a8272545f168b4c4ced230ce39e Depends-On: Ib37913891bbf7a31b570404c4668c490d5ac859b Closes-Bug: #1667266
* Merge "Make test_server.py more elegant and simple"Jenkins2017-04-251-14/+7
|\
| * Make test_server.py more elegant and simpleDavid Rabel2017-04-211-14/+7
| | | | | | | | | | | | | | | | Use only one line for mocking network resources like ports and networks in test_server.py. Change-Id: I451a504c3afdd365e64d66079516ec6308c206db Depends-On: I624b1bc557a195bdf8a7c5a32dc0e72a6fa8b075
* | Merge "Add --network and --port to server create"Jenkins2017-04-251-10/+34
|\ \ | |/
| * Add --network and --port to server createDavid Rabel2017-04-071-10/+34
| | | | | | | | | | | | | | | | | | --nic option is quite unhandy. It is better to have two seperate options --network and --port to add a network to a new server. Change-Id: I523abdc83ca2dd4c5dd3871f8f109c2bf57c2e02 Closes-Bug: #1612898
* | Low-level Compute v2 API: floating ip poolDean Troyer2017-04-181-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | api.compute.APIv2 floating ip pool function. novaclient 8.0 is now released without support for the previously deprecated nova-net functions, so include a new low-level REST implementation of the removed APIs. Also includes a handful of cleanups that the previous security group and floating IP reviews missed. Change-Id: I20116ec4fc1113857d8d917bfb30fa3170d05b9f
* | Low-level Compute v2 API: networkDean Troyer2017-04-172-29/+22
| | | | | | | | | | | | | | | | | | | | api.compute.APIv2 network functions. novaclient 8.0 is now released without support for the previously deprecated nova-net functions, so include a new low-level REST implementation of the removed APIs. Change-Id: If230f128e91cda44461fe93c976cac2aecec2252
* | Merge "Low-level Compute v2 API: floating ip"Jenkins2017-04-171-5/+1
|\ \
| * | Low-level Compute v2 API: floating ipDean Troyer2017-04-111-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | api.compute.APIv2 floating ip functions. novaclient 8.0 is now released without support for the previously deprecated nova-net functions, so include a new low-level REST implementation of the removed APIs. Change-Id: Ic461b8d15e072e0534dcd73fff6857581d83c89b
* | | Low-level Compute v2 API: security group rulesDean Troyer2017-04-111-4/+1
|/ / | | | | | | | | | | | | | | | | | | api.compute.APIv2 security group rule functions. novaclient 8.0 is now released without support for the previously deprecated nova-net functions, so include a new low-level REST implementation of the removed APIs. Change-Id: Ieabd61113bc6d3562738686f52bb06aa84fca765
* | Low-level Compute v2 API: security groupDean Troyer2017-04-112-31/+29
| | | | | | | | | | | | | | | | | | | | api.compute.APIv2 starts with security group functions. novaclient 8.0 is now released without support for the previously deprecated nova-net functions, so include a new low-level REST implementation of the removed APIs. Change-Id: Id007535f0598226a8202716232313e37fe6247f9
* | Enable to specify which fixed-ip to add to a vm.Cedric Brandily2017-04-041-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enables to specify which fixed-ip will be added to a vm using: openstack server add fixed ip <vm> <network> --fixed-ip-address <ip> This change uses interface_attach instead of add_fixed_ip[1] which is less flexible and uses a deprecated API. [1] https://review.openstack.org/384261 Closes-Bug: #1678140 Change-Id: I7fe4621439ef0d8dca080551ffaeb614c5a91174
* | Merge "Enable to add/remove port to/from a server"Jenkins2017-04-031-0/+96
|\ \
| * | Enable to add/remove port to/from a serverCedric Brandily2017-04-031-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enables to add/remove a specific port to/from a server using the new commands: openstack server add port <vm> <port> openstack server remove port <vm> <port> Closes-Bug: #1678137 Change-Id: I6ee57df089235ccc1fb9d38316bd484956b1134d
* | | Fix block-device-mapping when volume_size is emptyJens Rosenboom2017-04-031-2/+1
|/ / | | | | | | | | | | | | | | | | The Nova API responds with an validation error when a bdm is submitted containing an empty volume_size. So instead omit that attribute when it is empty. Change-Id: Iba905fca8c440a03e828c20922f3b813bba3fa3a Closes-Bug: 1677236
* | Merge "OSC Quota List"Jenkins2017-03-211-0/+64
|\ \
| * | OSC Quota ListSindhu Devale2017-03-101-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | Implement Neutron feature of Quota List into OpenStack Client. Change-Id: Idf941acf8d00b136776b7381b877c56d82622f57 Partially-Implements: blueprint neutron-client-quota
* | | Merge "Enable to specify which vm fixed-ip to publish"Jenkins2017-03-211-3/+12
|\ \ \
| * | | Enable to specify which vm fixed-ip to publishCedric Brandily2017-03-201-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enables to specify which vm fixed-ip will be associated to a floating ip using: openstack server add floating ip <vm> <fip> --fixed-ip-address <ip> Closes-Bug: #1624524 Change-Id: I2ddb68c5873bfed7293b0e661d1adbe111681136
* | | | Merge "Adds missing flavor information in the server list long command"Jenkins2017-03-201-0/+10
|\ \ \ \
| * | | | Adds missing flavor information in the server list long commandJose Castro Leon2017-03-131-0/+10
| | |_|/ | |/| | | | | | | | | | | | | | | | | | Closes-Bug: #1672396 Change-Id: Ie2a664fd1c3db1b8269ea079df181f87afc702a7
* | | | Merge "Add a validation about options for server migrate command"Jenkins2017-03-161-0/+203
|\ \ \ \ | |/ / / |/| | |
| * | | Add a validation about options for server migrate commandRikimaru Honjo2017-03-011-0/+203
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behavior of server migrate command are different depending on whether user specify --live option or not. server migrate command will call live migration API if user specify --live option. Ohterwise server migrate command will call migration(cold migration) API. Now then, "--block-migraiton" option and "--disk-overcommit" option only affect live-migration. But, openstackclient doesn't warn user if user specify these options without "--live". But, user can't recognize that specifying options are ignored. This patch adds a validation that checks whether or not user specify these options without "--live". Change-Id: Ifa278abb23ecdba4b13f3742998359ac74eb7ad4 Closes-bug: #1662755
* | | Merge "Add "--private-key" option for "keypair create""Jenkins2017-03-081-0/+31
|\ \ \
| * | | Add "--private-key" option for "keypair create"Rui Chen2017-03-061-0/+31
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Aim to specify the private key file to save when keypair is created. That is a convenient way to save private key in OSC interactive mode, avoid to copy CLI output, then paste it into file. Change-Id: I119d2f2a3323d17ecbe3de4e27f35e1ceef6e0a5 Closes-Bug: #1549410
* | | Add server event list and show commandsRui Chen2017-03-072-0/+211
|/ / | | | | | | | | | | | | | | | | | | | | | | OSC server event is similar to nova's instance action commands. Server event is the event record that had been done on a server, include: event type(create, delete, reboot and so on), event result(success, error), start time, finish time and so on. These are important information for server maintains. Change-Id: I8111091f46a0d2755728d8f9d43cc0dfe8842d13 Closes-Bug: #1642030
* | Merge "Use public and unified method get_console_url()"Jenkins2017-02-201-16/+12
|\ \ | |/ |/|
| * Use public and unified method get_console_url()huangtianhua2017-02-141-16/+12
| | | | | | | | | | | | | | | | | | | | Novaclient has provided a public and unified method get_console_url() to get console urls of server. This change switches to use it. Change-Id: Ie6b9d8cfc57a6943b5d64a4064e4bdd372cd8cd3 Depends-on: I36c6209b17ef453e1c2e47841daf41f81af471dc Closes-Bug: #1654913
* | Fix "server create" command failed when --nic auto or noneRui Chen2017-02-151-0/+146
|/ | | | | | | | | | | "auto" and "none" options was added into --nic argument of server create command in patch https://review.openstack.org/#/c/412698/ , but that don't work and raise internal error when execute command. The patch fix that issue and add unit and functional tests. Change-Id: Ia718c3bac0a5172a0cdbe9f0d97972a9346c1172 Co-Authored-By: Kevin_Zheng <zhengzhenyu@huawei.com> Closes-Bug: #1663520
* Merge "Overwrite/Clear Flavor property"Jenkins2017-02-131-0/+17
|\
| * Overwrite/Clear Flavor propertyReedip2017-02-131-0/+17
| | | | | | | | | | | | | | | | | | | | This patch adds support to overwrite/clear the flavor's property using the new ``--no-property`` option in the ``flavor set`` command. Change-Id: I873c96fcf223bbd638a19b908766d904a84e8431 Implements: blueprint allow-overwrite-set-options Co-Authored By: zhiyong.dai@easystack.cn
* | Add choices for option '--policy'zhiyong.dai2016-11-271-34/+3
|/ | | | | | | | | | When creating server group, the '--policy' option is required, but valid choice is 'affinity' or 'anti-affinity', adding multiple policies will produce an error. This patch add choices and default value for option '--policy', and remove the former help message. Change-Id: I312680af384363b3e9a7de9aa1f0946643e193e2 Closes-Bug: #1662771
* Merge "Add options to "server list" command"Jenkins2017-01-261-0/+46
|\
| * Add options to "server list" commandjiahui.qiang2017-01-251-0/+46
| | | | | | | | | | | | | | Add "--deleted" and "--changes-since" options to "server list" command. Change-Id: Id94f6e5831a60b172b6cfcfca29b1d89de8db621 Closes-Bug:#1647242
* | Switch server create to block_device_mapping_v2Nikita Gerasimov2017-01-261-9/+14
|/ | | | | | | | | | | | | | | | | | | | | | | | | Current compute_client.servers.create() relies on block_device_mapping arg which is legacy[1]. "block_device_mapping" format require device_name which is leads to hard-coded hack in --volume key handler to KVM specific. "block_device_mapping_v2" format is more friendly to hypervisiors. Support of block_device_mapping_v2 appear in python-novaclient 2.16.0, openstackclient require at least 2.29.0 Makes options --volume and --block-device-mapping work simultaneously. Appends --block-device-mapping data even if --volume used. After bug 1383338 only --volume was taken when both are used. [1]http://docs.openstack.org/developer/nova/block_device_mapping.html NOTE(dtroyer): I moved the new test_boot_from_volume() functional test to Ie51b1c375c5940856ec76a5770df3c6bd18a3eba to test our previous behaviour. The only changes required to support the new behaviour should be that the empty_volume is now attached in that test. Change-Id: I7bac3d870dd9ca404093142f8bce22a62e49180d Closes-Bug: 1647406 Closes-Bug: 1497845
* Use image client for images instead of computeArtom Lifshitz2017-01-241-13/+10
| | | | | | | | | | | | | With the deprecation of the Nova proxy APIs in microversion 2.36 [1], any operation that uses a microversion higher than 2.36 and works with images will fail because the /images endpoint will return 404. This patch updates openstackclient to query images using the image client in places where previously the compute client was used. [1] http://docs.openstack.org/developer/nova/api_microversion_history.html#id33 Change-Id: Ia66e44e530799ce6531922dcf6a84e38528c8725 Closes-bug: 1630161
* Fix creating a private flavor with ID autoJens Rosenboom2017-01-051-3/+2
| | | | | | | | | When a private flavor is created with ID auto (=default) and a project is specified for it, instead of trying to add the project to the flavor called "auto" the ID of the newly created project should be used. Change-Id: I19f7a0ec26bd5d147f00ecba3312240e3601567e Closes-Bug: 1654221
* Add unit tests for usage commands in compute v2jiahui.qiang2016-12-262-0/+244
| | | | | | | | Add unit tests and fakes for command below in compute v2: usage list usage show Change-Id: Ie533e23375ca6b8ba4cb7e865d39fac652cc0195
* Add unit tests for server create in computev2jiahui.qiang2016-11-281-0/+151
| | | | | | | Unit tests for server create is not completed. Some of the code in take_action has not been tested. Change-Id: Ifd3f42400408d3437e0bc6cd42acbb6db861b1f3