Add the validation framework necessary to verify extra specs along with
the definitions for every extra spec we currently recognize in-tree.
None of this is currently used since we don't have the API microversions
wired up, but that will come in a future patch.
Note that we must add the H238 hacking check to the ignore list here,
since this includes our first use of Python 3-type classes without the
explicit 'object' subclass. This can be removed when that check is
removed from hacking.
Part of blueprint flavor-extra-spec-validators
Change-Id: Ib64a1348cce1dca995746214616c4f33d9d664bd
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Allow PUT /servers/{server_id}/os-volume_attachments/{volume_id}``
to support specifying ``delete_on_termination`` field in the request
body. This allows updating the attached volume's flag that controls
whether or not it is automatically deleted when the instance is deleted.
When we request 'volumeId' and 'delete_on_termination' in the requst
body to swap volume, since the new microversion it will be support
updating the swapping volume's delete flag.
Co-Authored-By: Dan Smith <dansmith@redhat.com>
Blueprint: destroy-instance-with-datavolume
Change-Id: I6ccac4e17f56b40e67c79d40f32558ef414685ea
To have a correct error message in case of failure the proper order
of parameters are:
self.assertEqual(expected, actual)
Change-Id: Ia0e909c6ed19f0fd49aa3aa5f5f7a9ea987d9080
This adds new defaults roles in server diagnostics API policies.
This policy is default to SYSTEM_ADMIN role.
Also add tests to simulates the future where we drop the deprecation
fall back in the policy by overriding the rules with a version where
there are no deprecated rule options. Operators can do the same by
adding overrides in their policy files that match the default but
stop the rule deprecation fallback from happening.
Partial implement blueprint policy-defaults-refresh
Change-Id: Ibecf2ea61d75ec574123094a1783f9d664000d98
Current tests do not have good test coverage of existing policies.
Either tests for policies do not exist or if they exist then they
do not cover the actual negative and positive testing.
For Example, if any policy with default rule as admin only then
test should verify:
- policy check pass with context having admin or server owner
- policy check fail with context having non-admin and not server owner
As discussed in policy-defaults-refresh, to change the policies
with new default roles and scope_type, we need to have the enough
testing coverage of existing policy behavior.
When we will add the scope_type in policies or new default roles,
then these test coverage will be extended to adopt the new changes
and also make sure we do not break the existing behavior.
This commit covers the testing coverage of existing server
diagnostics policies.
Partial implement blueprint policy-defaults-refresh
Change-Id: I98faf703fea615d553700dd3c151c044fbc46821
This adds new defaults roles in remote console API policies.
- lock/unlock policies are default to system admin or project member.
- unlock server locked by other is system admin.
Also add tests to simulates the future where we drop the deprecation
fall back in the policy by overriding the rules with a version where
there are no deprecated rule options. Operators can do the same by
adding overrides in their policy files that match the default but
stop the rule deprecation fallback from happening.
Partial implement blueprint policy-defaults-refresh
Change-Id: Ic81da0ebc23d6526c5ca2d9d98159e07f3e53822
limits and used_limits extensions were megred in
- I76e02214e958a55b6de8033243b46b259949e5ac
But policy were left in separate file. limits policy
is in policies/limits which is general policy to get the
limit of project. used_limit is in polocies/used_limit
which is enforced in view builder for gettting the limit
of other project.
This commit:
- move used_limit in policies/limit file
- move the used_limit policy enforcement from view buidler to limit API controller.
- adjust the tests due to above changes.
Partial implement blueprint policy-defaults-refresh
Change-Id: Iefe41cc95cd967b368588dea5ff195bb4af3eca7
The updated minimum required libvirt (4.0.0) and QEMU (2.11)
for "Ussuri" satisfy the version requirements; this was done
in Change-Id: Ia18e9be4d (22c1916b49 — libvirt: Bump
MIN_{LIBVIRT,QEMU}_VERSION for "Ussuri", 2019-11-19).
Drop the version constant QEMU_VERSION_REQ_SHARED and now-needless
compatibility code; adjust/remove tests.
Change-Id: If878a023c69f25a9ea45b7de2ff9eb1976aaeb8c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This change addresses an old TODO in the images module by dropping the
use of a Libvirt specific configurable from the qemu_img_info function.
We can identify RBD based volumes by checking for 'rbd:' at the start of
the path provided to the function instead of using the configurable.
Change-Id: Ife9e67d5c71f4cca825dff713f54ec955508f6e6
Since 0.9.11 virDomainBlockResize has accepted the size argument in
bytes when the VIR_DOMAIN_BLOCK_RESIZE_BYTES flag is provided.
This change switches all callers over to using bytes to simplify the
required call, avoiding the need to divide by units.Ki etc.
Change-Id: Ib8d9318596186acd86a738ceea187420698645e6