These are all deprecated for over 18 months (change
I0dd38e5cb252a01d5817ed168be040b21b35e348). It's time to remove them and
simplify this code.
Change-Id: I9ee3bfebbad21eec3eb1b475a813bcbc450edea4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ibdd329a6db8bd176af065d7f5190f0901d3c3f8d
This was incorrectly grouped as a general compute quota, when in fact
it's a nova-network quota. Move it.
Change-Id: If93c95bc181ab766137b61943a09821810345300
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
These should have been cleaned up as we went but weren't. Fix things
now.
Change-Id: I80b29c0fd6e4f557c2efc45474279306f50c4fd7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
None of these are actually supported by openstacksdk (intentionally so)
so we add our own manual implementations.
Change-Id: Ifd24f04ae4d1e56e0ce5ba0afe63828403bb7a6f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
The final step. Future changes will clean up the remnants of the
novaclient usage. This is a rather large patch, owing to the number of
things that novaclient was handling for us which SDK does not, but the
combination of unit and functional tests mean we should be handling
all of these differences.
Change-Id: I623e8c772235438a3d1590e1bbd832748d6e62ea
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Currently this check is handled by novaclient. In the future, we won't
have that so we need to do it ourselves. Do so now, fixing a typo along
the way and adding tests to prevent regressions.
Change-Id: Iaa9c087d846390b6a4f95ed3fa121dd8dc640903
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Migrate the following commands:
- 'server delete'
- 'server rescue'
- 'server unrescue'
- 'server resize'
- 'server resize confirm'
- 'server resize revert'
- 'server migrate confirm'
- 'server migrate revert'
- 'server remove fixed ip' ('server add fixed ip' was already migrated)
- 'server ssh'
That leaves a few commands to migrate, all of which are called out with
TODOs.
Change-Id: Idb769a93609da522c458e719bc69a63ff2ab107b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We can use a detailed list instead when looking up by name. We also
improve tests somewhat.
Change-Id: I18b38e7fbcac813190b304c4d67d8ea03d8c1a80
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This affects the 'server create', 'server show', 'server rebuild' and
'server set' commands. We also fix a few mistakes around the fields
shown.
Change-Id: I9946e12146efff39f9ba1591c90a4a9bccd46919
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We need to work around SDK's (intentional) lack of support for Nova's
deprecated '/os-security-groups' API but it's nothing too crazy.
Change-Id: I03ca1a73f98aa77b288148607baff336dae69fb1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This patch migrates the volume attachment create, get, list,
delete, update and complete commands to SDK.
Change-Id: Ib237d25cc1c3fc72946b9d088ff3447433162130
This beats the horrible mess of mocks we have created for ourselves.
Change-Id: I8af3ce0a0b10f52e2124ec86f306327ff3474982
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This was the sole outstanding command to be migrated to SDK. We also
clean up the old in-tree wrappers we have in the process and add missing
error checks for the 'host list' and 'host show' commands.
Change-Id: I5635469b63ab3370fb5118e4f8a1758002381aa5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
These are not supported by SDK natively (intentionally so) so we use raw
HTTP requests to manage this migration.
Change-Id: I72fa0d6f87899537a24090995b1ba884bc5f9d4d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We use the compute client here to look up server IDs when filtering by
'device_id'.
Change-Id: I76515eaa4ce4e7c7d0173d2e0a91d7564ba7041a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This is a little more realistic. We fix a minor bug along the way and
start ignoring some newly added create-only fields.
Change-Id: I93eae610e16e2a3a859f684b889546ace3afa683
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
The incremental volume backup stopped working after we moved from
cinderclient to SDK[1]. This happened because SDK accepts the
``is_incremental`` parameter[2] rather than the ``incremental`` parameter
which is actually passed in the API request and was previously a valid
parameter for cinderclient.
This patch fixes the issue by passing the ``is_incremental`` field instead
of ``incremental`` from the OSC side which adds the ``incremental`` parameter
in the API request.
Request body after the fix:
'{"backup": {"name": null, "description": null, "volume_id": "<vol-id>",
"force": false, "container": null, "incremental": true}}'
[1] https://review.opendev.org/c/openstack/python-openstackclient/+/889748
[2] 10e5e20fc0/openstack/block_storage/v2/backup.py (L126-L134)
Closes-Bug: #2070080
Change-Id: I89bd3d2751267ec39f4dbd664b7873ab87a9ac6c
We don't need to transform one HTTP Forbidden-related error to another:
just use the original one. This also fixes an issue where we would end
up with an undefined variable (server_id) if a non-HTTP 403 exception
was raised, since that would be blindly ignored.
Change-Id: Icdd1764b6f2df4a635e3264ed8f93a115cc52ef2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-Bug: #2062010
This patch adds the ``Cluster`` and ``Backend State`` columns to
the ``openstack volume service list`` command. Note that you need
to provide the appropriate microversion to show these columns.
Cluster: openstack --os-volume-api-version 3.7 volume service list
Backend State: openstack --os-volume-api-version 3.49 volume service list
Change-Id: Ie7727d0001307b5d5a40d7ea0348bdb9626f9e03
This patch adds support for unmanaging a volume with the
``openstack volume delete --remote`` command.
Change-Id: Id71681e817f6e56b4ef553079f0bcfac8252d3cf
The simplejson library is not included by the requirements but it was
directly imported. Drop the direct inclusion and use the alias in
the requests library to avoid ImportError caused by missing simplejson
in the environment.
Also fix the missing requests library in requirements.
Change-Id: I8713f45c5f2717cc53ba043aaeb479e72f641f78
This patch adds support for the cinder manage command to
bring a volume under OpenStack management.
Change-Id: I12b63bfc4f0c9bc29cf9d4efd9a5cd038ec00af3
This patch acts as a base framework to add the parameters needed
for manage volume support.
This includes 2 changes:
1. Move get_parser and take_action code to common methods which
can be utilized by both v2 and v3
2. Make _check_size_arg as a static method and move it inside
CreateVolume class since it's not used by other classes.
[2] was initially thought to be a follow up change but since we
are implementing changes into the _check_size_arg method for v3,
it makes sense to just include it in CreateVolume class to avoid
adding a new additional method. Similar changes are done for v2
as well.
Change-Id: I9315e457ebd6c5ba4cc67452f92c9dc8c139ee3c
We were seeing the following test failures on Python 3.12:
openstackclient.tests.unit.common.test_module.TestModuleList.test_module_list_all
openstackclient.tests.unit.common.test_module.TestModuleList.test_module_list_no_options
Both failures were caused by missing attributes of 'sys', e.g.
AttributeError: module 'sys' has no attribute 'builtin_module_names'
Fix this by exposing the real 'sys' module as part of our mock of
'sys.modules'.
Change-Id: I17391a46f08896f49dccaf75ad685dab1375a03d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>