Commit graph

4116 commits

Author SHA1 Message Date
Zuul
c8ecba2a9e Merge "image: Fix the default description of image visibility" 2024-02-02 11:23:51 +00:00
Zuul
c29e05764b Merge "Add "hardware_offload_type" attribute to "port"" 2024-01-30 12:16:43 +00:00
Zuul
f0f811ce4b Merge "[codespell] fix typos in doc,tests and help messages" 2024-01-30 09:34:00 +00:00
Zuul
5435f11dd0 Merge "image: Trivial fixes" 2024-01-29 19:41:46 +00:00
Stephen Finucane
8a63b51039 image: Trivial fixes
Mostly stylistic, with the exception that we now allow deleting multiple
metadef properties in a given namespace.

Change-Id: Ib0c243f0d647ce74c0165ee666beed6eb5d5c5a7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-01-29 13:53:34 +00:00
Rafael Weingärtner
2ed10e9a72 Introduce schema_version in the federated attribute mapping API
Depends-On: https://review.opendev.org/c/openstack/keystone/+/739966
Change-Id: I276ebd49094368dd823e50ff11a6e65fa2a6dcfb
2024-01-29 08:50:48 -03:00
Zuul
dc8d9d3541 Merge "Adding CLI command for `glance member-get`" 2024-01-26 17:37:15 +00:00
Zuul
9cb8e4c3b5 Merge "Explicitly specify namespace fields for output" 2024-01-26 17:37:11 +00:00
Rodolfo Alonso Hernandez
0725bb474c Add "hardware_offload_type" attribute to "port"
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/892771
Related-Bug: #2013228

Change-Id: I2c6fd434be4ae8cc41edf45fefe150a41cbfe0bd
2024-01-24 14:33:23 +00:00
Zuul
50544ae78b Merge "compute: Fix formatting of 'server show'" 2024-01-18 14:12:32 +00:00
Mridula Joshi
1517f4af21 Explicitly specify namespace fields for output
Rather than excluding the few fields we don't want, explicitly indicate
the ones we do want.

Note that this is a problem in the tests for virtually all commands
that will be seen as the SDK continues to evolve and new fields are
added to existing resources.

Change-Id: Ia8d487e1e7804fa177fce46497c0202aed8acb08
2024-01-16 15:14:55 +00:00
Zuul
4bafc32616 Merge "Fix clearing of dns_domain and description on a network by setting to empty strings" 2024-01-10 18:31:42 +00:00
Zuul
b740f2f6bd Merge "Correct error message for "create server --wait"" 2024-01-10 16:09:48 +00:00
Bence Romsics
cc2a0bab24 Correct error message for "create server --wait"
Error message should say "Error creating server" and not "unshelving".

Change-Id: I49dc6160f47a13d38128b3da1ba16437bd089c86
Closes-Bug: #2048896
2024-01-10 14:19:35 +01:00
Brian Haley
e7bc3d9b82 Fix --use-prefix-delegation subnet create argument
The --use-prefix-delegation argument when creating a
subnet should not take an argument of True/False, it
should simply trigger the code to set subnetpool_id
value to 'prefix_delegation'. Change action to correct
this.

Added unit test to cover missing checks.

Related-bug: #2028159
Change-Id: Ib7ee80100327b8611d4a354c7f4eb0e696c953da
2024-01-09 17:23:03 -05:00
Mridula Joshi
93b2e66d2d Adding CLI command for `glance member-get`
This patch adds a command ``image member get`` which displays
a particular member associated to the image.

Change-Id: I48d3151f8e204e1eb5cfff67ce1e333d1cfb9322
2023-12-20 05:03:40 +00:00
Stephen Finucane
be3d438ed2 trivial: Place positional opts last
Change-Id: I5479e71223c8c224e0bba387348e740c997cc7bf
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-12-14 12:31:26 +00:00
Stephen Finucane
1b6b639c9f network: Clarify purpose of default sg rules
These only apply to newly created default security groups i.e. when you
create a new project. They do not apply to existing default security
groups.

Change-Id: Ie01bf47dd8a0392354d17d984b41c1fad504e659
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-12-14 12:30:03 +00:00
Pavlo Shchelokovskyy
f3207bdf3f Fix availability zone list command
there are two problems currently:
- SDK's `availability_zones()` returns a generator that raises errors
  only when actually accessing its items
- the error raised is the sdk exception, not nova one, and thus is not
  being handled correctly

As a result, currently nova AZs can not be listed by non-admins.

Story: 2010989
Task: 49220
Change-Id: Ia299faea85857d3fc3a9b539800f3483f84ccbc0
2023-12-07 16:24:34 +00:00
Zuul
2642b070db Merge "compute: Add 'server create --server-group' option" 2023-12-05 18:43:15 +00:00
Zuul
2957f28ff1 Merge "tests: Enable logging fixture" 2023-12-05 18:43:13 +00:00
Zuul
ca0473815f Merge "tests: Remove prints" 2023-12-05 18:43:11 +00:00
Zuul
ac2bd42372 Merge "test: Ignore 'OS_' environment variables" 2023-12-05 18:43:02 +00:00
Zuul
b458e78694 Merge "tests: Remove unused flag" 2023-12-05 18:43:01 +00:00
Zuul
519596dcb7 Merge "parseactions: Use ArgumentError, not ArgumentTypeError" 2023-12-05 18:42:59 +00:00
Zuul
b1548d9f3c Merge "Remove unnecessary file" 2023-12-05 18:35:48 +00:00
Zuul
2d32d87c16 Merge "Use CommandError, not SystemExit, to exit" 2023-12-05 18:35:47 +00:00
Zuul
0ac2e2f630 Merge "compute: Address bug in shelve offload logic" 2023-12-05 18:15:08 +00:00
Zuul
1da22d0de4 Merge "tests: Handle missing extensions in network tests" 2023-11-29 18:19:43 +00:00
Florian Streibelt
ce0765facb
Fix clearing of dns_domain and description on a network by setting to empty strings
After setting a default dns_domain on a network

 openstack net set --dns-domain 'example.com.' <NETWORKID>

the setting could not be reverted back to an empty string using

 openstack net set --dns-domain '' <NETWORKID>

and the call also does not emit any error.

The same is true for the description of a network.

Reason was using the parsed argument directly as a condition instead of
comparing against None -- dropping the empty string as valid value.

The name parameter already accepted an empty string.

This change also adds a testcase for dns_domain, description and the
network name parameter, checking if the empty string is forwarded.

Change-Id: Ia7b9738205002b028c19e4f397411c86469cba1a
2023-11-24 12:36:07 +01:00
Zuul
127b49d45e Merge "tests: Check for DHCP agents first in DHCP test" 2023-11-22 13:46:42 +00:00
Zuul
19896ec720 Merge "Adds command `image metadef object delete`" 2023-11-22 11:05:26 +00:00
ArtofBugs
6d3490ed7c tests: Handle missing extensions in network tests
Some tests still assume extensions are enabled; those tests are now skipped if the extension is not enabled. Change I25b8811fe09f2a4a9fc20ca5459f5a404b88a337 addressed some but not all of these.

Change-Id: If36550650f143a7efe4190e60961c51a8cd20fb3
2023-11-21 09:50:51 -08:00
Stephen Finucane
e44d8017ec tests: Check for DHCP agents first in DHCP test
If there are no agents with type=dhcp, the neutron-dhcp-agent service is
likely not enabled on the deployment.

Change-Id: I1253f35e71cf996c559f2a2d8d1d8cde6b41a519
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-21 10:31:01 +00:00
Rajesh Tailor
71839eb5fa [codespell] fix typos in doc,tests and help messages
Change-Id: I4823782daa1af3872bc22603147e3073152cc777
2023-11-21 11:31:07 +05:30
Mridula Joshi
5d1afcee68 Adds command `image metadef object delete`
Change-Id: Ib94b7ba625ca0679ae4ae841e217ea251baff371
2023-11-17 10:46:35 +00:00
Stephen Finucane
e9d3a7bb13 test: Ignore 'OS_' environment variables
Our functional tests are inherently dependent on 'clouds.yaml' files.
The presence of 'OS_*' environment variables can cause weird test
failures. Simply don't pass them through to our test environment.

Change-Id: I7d24cdff5f1f5798118816b12d7398b87a5f5ed4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 11:41:13 +00:00
Stephen Finucane
c08d6e0391 parseactions: Use ArgumentError, not ArgumentTypeError
If you use the former, you get a pretty error message when there's a
failure. If you use the latter, you get an ugly traceback when used with
the '--debug' flag.

Without this change:

  $ openstack flavor create ... --property '' foo
  ...
  Traceback (most recent call last):
    File "/tmp/venv/lib/python3.11/site-packages/cliff/app.py", line 402, in run_subcommand
      parsed_args = cmd_parser.parse_args(sub_argv)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/argparse.py", line 1862, in parse_args
      args, argv = self.parse_known_args(args, namespace)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/argparse.py", line 1895, in parse_known_args
      namespace, args = self._parse_known_args(args, namespace)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/argparse.py", line 2107, in _parse_known_args
      start_index = consume_optional(start_index)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/argparse.py", line 2047, in consume_optional
      take_action(action, args, option_string)
    File "/usr/lib64/python3.11/argparse.py", line 1971, in take_action
      action(self, namespace, argument_values, option_string)
    File "/tmp/venv/lib/python3.11/site-packages/osc_lib/cli/parseractions.py", line 45, in __call__
      raise argparse.ArgumentTypeError(msg % str(values))
  argparse.ArgumentTypeError: Expected 'key=value' type, but got:
  clean_up CreateFlavor: Expected 'key=value' type, but got:

With this change:

  $ openstack flavor create ... --property '' foo
  ...
  usage: openstack flavor create [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN]
                                 [--noindent] [--prefix PREFIX] [--max-width <integer>]
                                 [--fit-width] [--print-empty] [--id <id>]
                                 [--ram <size-mb>] [--disk <size-gb>]
                                 [--ephemeral <size-gb>] [--swap <size-mb>]
                                 [--vcpus <vcpus>] [--rxtx-factor <factor>]
                                 [--public | --private] [--property <key=value>]
                                 [--project <project>] [--description <description>]
                                 [--project-domain <project-domain>]
                                 <flavor-name>
  openstack flavor create: error: argument --property: Expected 'key=value' type, but got:
  clean_up CreateFlavor:

Change-Id: I9e78b35ad9d016d7a33655141ec579397c5344c0
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 11:33:19 +00:00
Stephen Finucane
3057997cae Remove unnecessary file
This is testing things now found in osc-lib. Remove it.

Change-Id: Iccbd540fa340c77a957486d16d352d3fe4c3ddb2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 11:29:06 +00:00
Stephen Finucane
432698fea2 Use CommandError, not SystemExit, to exit
Change-Id: Id2bcc18420b17cf3afed5584ef5104c3ef413830
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 11:28:49 +00:00
Stephen Finucane
885f5912eb compute: Address bug in shelve offload logic
We were reusing a variable from a previous loop, which meant this would
never work with multiple servers. Correct the mistake.

Change-Id: I52246e183fb2cf0d855d92058dd305b48783589d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 11:26:02 +00:00
Stephen Finucane
900fad5360 tests: Remove unused flag
Nothing is setting 'merge_stderr'. It looks like a carry-over from the
legacy clients.

Change-Id: I32b65830e11b27ba83dfba002bf996af561b0768
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-14 12:19:06 +00:00
Stephen Finucane
89a8f72960 tests: Enable logging fixture
Quieten the output of our test runs significantly.

Change-Id: Ie32c919bb987eb0b9bc4c5b2ec54ee20a6841c03
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-11-13 17:31:07 +00:00
Stephen Finucane
d0d4077e1d tests: Remove prints
Change-Id: I35adac1199769fd73978b6457044191d02bb5bd4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-13 17:31:07 +00:00
Stephen Finucane
1678f87d7a tests: Handle missing extensions in network tests
This is mostly a case of skipping tests where the extension is missing,
but some tests are updated to remove a reliance on optional tests.

Change-Id: I25b8811fe09f2a4a9fc20ca5459f5a404b88a337
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-12 10:35:38 +00:00
Stephen Finucane
c251cb89a5 tests: Fix API extension check
The check for extensions was not using a machine readable format for
output. This meant an API check could match on a substring, e.g. a check
for 'qos' would match on 'qos-specs'. Address this issue by switching
our command invocation to use JSON output and migrating the check
function from the general base class to the networking base class.

Change-Id: Idc6dc54503031ddf3e148f50ed53ad8898f7a7e3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-12 10:34:41 +00:00
Zuul
7dbe6e6d3d Merge "tests: Centralise check for networking service" 2023-11-10 13:55:41 +00:00
Stephen Finucane
20490dcd10 tests: Centralise check for networking service
No point duplicating this across functional tests.

Change-Id: I9502be8b4e718885c6f854c7f5b19f6cacf51055
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-10 10:06:58 +00:00
Zuul
1ac5d63c53 Merge "Adds command `image metadef object list`" 2023-11-08 18:01:44 +00:00
Zuul
8aee1a2889 Merge "Adds command `image metadef object show`" 2023-11-08 18:01:42 +00:00