summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* Merge "config: Also mask non-prefix config"Zuul2022-09-302-31/+66
|\
| * config: Also mask non-prefix configryanKor2022-08-012-31/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "network: Add tenant project filter for RBAC list"Zuul2022-09-301-0/+19
|\ \
| * | network: Add tenant project filter for RBAC listJan Hartkopf2022-09-061-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements a new parser argument "--target-project" to list RBAC policies for a specific tenant project only. This uses the already existing server-side query parameter "target_tenant". Story: 2009937 Task: 44824 Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/834442 Change-Id: I83ff07041a022e8795e3c5550c6a7aabb0c0d8c8 Signed-off-by: Jan Hartkopf <jhartkopf@inovex.de>
* | | Merge "Replace assertItemsEqual with assertCountEqual"Zuul2022-09-303-15/+15
|\ \ \
| * | | Replace assertItemsEqual with assertCountEqualTakashi Natsume2022-09-193-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assertItemsEqual were replaced with assertCountEqual in I0bbffbec8889b8b3067cfe17d258f5cb16624f38. However the following changes add assertItemsEqual after that. * I1095100efb27b8559412469f0a9d07fc0a3db9d5 * Ic230c2c5cda8255d8f2c422880aeac81670b2df3 * Ica3320242a38901c1180b2b29109c9474366fde0 So Replace assertItemsEqual with assertCountEqual again. Change-Id: I11ff1748225e434f64dbaf7b88dc80ba28a5e2a0 Signed-off-by: Takashi Natsume <takanattie@gmail.com>
* | | | image: Add 'image task list' commandStephen Finucane2022-09-212-1/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the 'glance task-list' command. $ openstack image task list We also indicate that the 'image task create' command will never be implemented. This is an admin-only API that isn't really intended to be used by humans thus it does not need an OSC command implementation. Change-Id: Id8a943a5443782fc70c0fbf3639f5aa17b9d30af
* | | | image: Add 'image task show' commandslsmman2022-09-212-0/+134
|/ / / | | | | | | | | | | | | | | | | | | | | | This replaces and the 'glance task-show' command. For example: $ image task show <TASK_ID> Change-Id: I74cb23e436c373fe238804b903bbeb28f643d5af
* | | compute: Add support for microversion 2.93whoami-rajat2022-09-141-0/+97
| | | | | | | | | | | | | | | | | | | | | Add '--reimage-boot-volume' and '--no-reimage-boot-volume parameters' to the rebuild command to allow rebuilding of volume backed instances. Change-Id: I4a6e30b2cf12f32202a2d9ef1ced347e1dd139f3
* | | compute: Require image when rebuilding a volume-backed serverwhoami-rajat2022-09-141-0/+19
|/ / | | | | | | | | | | | | | | | | | | | | | | | | A volume-backed server will have no image attribute (or rather the image property will be set to the empty string). As such, if you want to try rebuild you will need to specify an image [*]. Enforce this. [*] Before microversion 2.93, this must be the same image. However, we don't touch on that here. This will be addressed later. Change-Id: I6842dabd7acb4e3a78f894e55e616625757eb6a4 Story: 2010297 Task: 46290
* | Merge "Microversion 2.91: Support specifying destination host to unshelve"Zuul2022-09-011-2/+177
|\ \
| * | Microversion 2.91: Support specifying destination host to unshelveRené Ribaud2022-08-221-2/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new parameter ``--host`` to ``openstack server unshelve`` command. This can help administrators to specify an ``host`` to unshelve a shelve offloaded server. And add new parameter ``--no-availability-zone`` to unpin a server availability These parameters are available in the 2.91 microversion. Depends-On: https://review.opendev.org/c/openstack/python-novaclient/+/831651 Implements: blueprint unshelve-to-host Change-Id: I7986adc7563f63bcd4b3caf5eb7bc4329b4e1eca
* | | Add router ndp proxy commandsYang JianFeng2022-08-262-0/+527
|/ / | | | | | | | | | | Depends-on: https://review.opendev.org/749036 Change-Id: I77e12cc2dfe4000bd5ae6511878c6591f52d9791 Related-Bug: #1877301
* | Migrate server_groups to the new APIViolet Kurtz2022-08-022-221/+159
| | | | | | | | | | | | Moved the server_groups to the new API. Change-Id: Ied7bd6f56e277f0c5efcd5ba028765f9be65050f
* | Merge "Add support for CRUD operations for QoS minimum packet rate rule"Zuul2022-07-202-7/+327
|\ \ | |/ |/|
| * Add support for CRUD operations for QoS minimum packet rate rulePrzemyslaw Szczerbik2022-07-012-7/+327
| | | | | | | | | | | | | | Closes-Bug: #1922237 Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/810364 See-Also: https://review.opendev.org/785236 Change-Id: Ie7e1eb0575fd37121d5097ecbc318d0769ab3db0
* | image: Make better use of argparseStephen Finucane2022-06-301-80/+36
|/ | | | | | | | Simplify some logic by using a common 'dest' for mutually exclusive options. Change-Id: Ie5f3600672953f40be52de51e84717c8912ddaf8 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Fix: create image from volume commandwhoami-rajat2022-06-301-1/+105
| | | | | | | | | | | | | | | | | | Currently the command ``openstack image create --volume`` calls cinderclient to upload the volume to image service (glance) but OSC passes ``visibility`` and ``protected`` fields which are only available in microversion 3.1 or greater. This generates an error if the user is using volume microversion < 3.1 and wants to create an image from volume. This patch fixes that by only passing ``visibility`` and ``protected`` fields when the volume microversion is 3.1 or greater and fail otherwise i.e. the following 3 cases: 1) visibility/protected argument + mv >= 3.1 = pass 2) visibility/protected argument + mv < 3.1 = fail 3) not visibility/protected argument + any mv = pass Story: 2010060 Task: 45511 Change-Id: I568a0ea0af8f7f82b16d49a6a1bb0391b99c50dc
* Merge "volume: Correct output of 'volume attachment create'"Zuul2022-06-271-1/+2
|\
| * volume: Correct output of 'volume attachment create'Stephen Finucane2022-05-161-1/+2
| | | | | | | | | | | | | | | | | | When adding these, we missed that the underlying cinder library call actually returns a dictionary and not a Resource-based object. This requires slightly different handling. Fix this. Change-Id: Ie065fe4198ae1238830cb619220e856390d4cb6e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "Allow users to list all images"Zuul2022-06-201-0/+32
|\ \
| * | Allow users to list all imagesCyril Roelandt2022-06-071-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | Add a "--all" option to "openstack image list", which allows the user to list all of the images. Story: 2010071 Change-Id: I56a2e4846d0380d07803305fb830d1a43dfd71b3
* | | Merge "Refactor "volume backup restore" command"Zuul2022-06-202-13/+113
|\ \ \
| * | | Refactor "volume backup restore" commandHuanxuan Ao2022-03-102-13/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the positional argument "volume" optional and add a "--force" option (volume v2 only) to the "volume backup restore" command. Closes-Bug: #1597189 Change-Id: If944e10158bd18e8331be63e96187a23e23095d7
* | | | Merge "Add more filter option of columns for server list -c COLUMN"Zuul2022-06-201-0/+14
|\ \ \ \ | |_|/ / |/| | |
| * | | Add more filter option of columns for server list -c COLUMNJIHOJU2022-04-191-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to improve the convenient of use, columns corresponding to the "--long" option has been added so that it can be used in the filter. Currently filterable columns include the following: 'ID', 'Name', 'Status', 'Networks', 'Image', 'Flavor'. Story: 2009150 Task: 43113 Change-Id: I6760ca5da0e3707d1d746ae5eeec7d9162020d15
* | | | Add 'Host Status' to 'server list --long' with >= v2.16melanie witt2022-05-161-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the 'Host Status' field is shown only for 'server show' but not for 'server list'. The host_status can be helpful for users who are having issues with servers that show a status of ACTIVE, as it can show a hint about the compute host status when nova policy is configured to allow it. Story: 2009689 Task: 44003 Change-Id: I6209cf52044218b7b32ab2fa5712574f12ba2f5f
* | | | Merge "Allow to filter multiple tags for image list"Zuul2022-05-161-2/+3
|\ \ \ \ | |_|_|/ |/| | |
| * | | Allow to filter multiple tags for image listDmitriy Rabotyagov2022-05-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently in case of passing `--tag` several times, only last one will be picked up for the filtering. In the meanwhile Glance allow option to be repeated multiple times to filter based on the multiple tags. Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/789827 Change-Id: I7379d0b0014f0e3d13b02ee5ec6b642a7a5aa7d1
* | | | Merge "Fix typos"Zuul2022-05-161-2/+2
|\ \ \ \ | |/ / / |/| | |
| * | | Fix typosCyril Roelandt2021-10-261-2/+2
| | | | | | | | | | | | | | | | Change-Id: Idd502c8df21da79ff3b9339870f38378f5337879
* | | | Merge "Refactor network fakes to sdk properties PART 4"Zuul2022-05-1313-429/+409
|\ \ \ \
| * | | | Refactor network fakes to sdk properties PART 4Nurmatov Mamatisa2022-04-2913-429/+409
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Included resources: port network_agent network_flavor_profile network_rbac Change-Id: I2e71a3c0fefb56ddcc75865c95746550e2710aa3
* | | | volume: Add 'block storage resource filter list' commandStephen Finucane2022-05-132-4/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are based on the 'cinder list-filters' command, which accepts an optional '--resource {resource}' option to limit the listed filters to a single resource type. block storage resource filter list block storage resource filter show We used the 'block storage resource filter' terminology rather than simply 'resource filter' to highlight the fact that this is specific to the block storage service. Note that while this feature is a bit weird, good documentation can be found at [1]. [1] https://docs.openstack.org/cinder/latest/admin/generalized_filters.html Change-Id: I21e7c0ea427aef1f6665394d4b8e9a1f30d6dbb1 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | volume: Add 'block storage cluster *' commandsStephen Finucane2022-05-132-0/+488
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These mirror the 'cinder cluster-*' commands, with arguments copied across essentially verbatim. The only significant departure is the replacement of "tenant" terminology with "project". block storage cluster list block storage cluster set block storage cluster show We used the 'block storage' terminology rather than simply 'volume' to allow us to start distinguishing between the volume service and a volume resource. Change-Id: I9105a9e4a139af4929e3b1f3a6de6c9a53e0b598 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | Merge "Refactor network fakes to sdk properties PART 3"Zuul2022-03-245-240/+199
|\ \ \
| * | | Refactor network fakes to sdk properties PART 3Nurmatov Mamatisa2022-03-165-240/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Included resources: network_flavor network_segment network_segment_range Change-Id: If5ce0a07052d9dc0edb4f5f22806635b5bb6a523
* | | | Merge "Refactor network fakes to sdk properties PART 2"Zuul2022-03-2312-219/+220
|\ \ \ \ | |/ / /
| * | | Refactor network fakes to sdk properties PART 2Nurmatov Mamatisa2022-03-1512-219/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Included resources: ip_availibility network Change-Id: I141bcb43272594da75e776a84a74158fc866ac94
* | | | Merge "Refactor network fakes to sdk properties PART 1"Zuul2022-03-238-257/+227
|\ \ \ \ | |/ / /
| * | | Refactor network fakes to sdk properties PART 1Nurmatov Mamatisa2022-03-158-257/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Included resources: address_group address_scope auto_allocated_topology availability_zone Change-Id: I943f988588efbe68dd3ab17a18441b25ac8c8d4d
* | | | Allow "--force" flag in quota network commandsRodolfo Alonso Hernandez2022-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | compute: Add 'Security Groups' for 'server list'Thobias Salazar Trevisan2022-03-151-0/+2
|/ / / | | | | | | | | | | | | | | | | | | Add a column with security groups name for --long option on server list. Change-Id: I7062f224e18c3c8ac96a06d7ce97f9fab473bdb9
* | | compute: Move server migrations commands to their own fileStephen Finucane2022-03-092-985/+1028
| | | | | | | | | | | | | | | | | | | | | | | | The 'openstackclient.compute.v2.server' module is getting rather large. The server migration commands don't need to be in there. Move them. Change-Id: I8b2600cfd9f8e37d3093c52c7222d85e84e7fc89 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | compute: Allow retrieval of migration by UUIDStephen Finucane2022-03-091-0/+208
| |/ |/| | | | | | | | | | | | | | | The nova API doesn't allow you to retrieve migration records by UUID, only ID. This is confusing. Work around it by listing records and filtering this list. Change-Id: I932c9c70420e85056509513e005bb78168e70611 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "Fix metavars and typos in local_ip"Zuul2022-03-091-1/+1
|\ \
| * | Fix metavars and typos in local_ipNurmatov Mamatisa2022-03-021-1/+1
| | | | | | | | | | | | Change-Id: I2094f343e3353da25f9c5057ea5444345e271665
* | | Add support for setting extra DHCP options on existing portsSlawek Kaplonski2022-02-211-0/+21
|/ / | | | | | | | | | | | | | | | | It is now possible to set extra DHCP option for an existing port using "port set" command. It works in the same way like during port creation. Story: 2009095 Task: 42927 Change-Id: I3577d4e3a303137b708ae8687c44b486aa82e296
* | Merge "image: Sanity check the 'SetImage' command"Zuul2022-02-091-9/+3
|\ \
| * | image: Sanity check the 'SetImage' commandStephen Finucane2021-11-171-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This was a very difficult command to grok, due to the layering on of additional features over the years. Make this a little easier to follow by grouping related logic and making use of argparse features. Change-Id: I4e1a0aed09ea5d6a8c26ec3e888c9c7b6cefc25a Signed-off-by: Stephen Finucane <sfinucan@redhat.com>