Replace glanceclient with openstacksdk

Nowadays, the SDK and the unified OpenStack client should be used
instead of the service-specific clients.

Change-Id: I9f67db82e8cd4ef8e6ff6186de17e8f84dabbbbd
This commit is contained in:
Cyril Roelandt 2024-10-03 15:52:18 +02:00
parent 3add6476fb
commit f1631ecb97
3 changed files with 4 additions and 5 deletions

View File

@ -15,7 +15,6 @@ import time
from cinderclient.v3 import client as cinderclient from cinderclient.v3 import client as cinderclient
import fixtures import fixtures
from glanceclient import client as glanceclient
from keystoneauth1.exceptions import discovery as discovery_exc from keystoneauth1.exceptions import discovery as discovery_exc
from keystoneauth1 import identity from keystoneauth1 import identity
from keystoneauth1 import session as ksession from keystoneauth1 import session as ksession
@ -24,6 +23,7 @@ from keystoneclient import discover as keystone_discover
from neutronclient.v2_0 import client as neutronclient from neutronclient.v2_0 import client as neutronclient
import openstack.config import openstack.config
import openstack.config.exceptions import openstack.config.exceptions
import openstack.connection
from oslo_utils import uuidutils from oslo_utils import uuidutils
import tempest.lib.cli.base import tempest.lib.cli.base
import testtools import testtools
@ -223,13 +223,13 @@ class ClientTestBase(testtools.TestCase):
self.client = self._get_novaclient(session) self.client = self._get_novaclient(session)
self.glance = glanceclient.Client('2', session=session) self.openstack = openstack.connection.Connection(session=session)
# pick some reasonable flavor / image combo # pick some reasonable flavor / image combo
if "flavor" not in CACHE: if "flavor" not in CACHE:
CACHE["flavor"] = pick_flavor(self.client.flavors.list()) CACHE["flavor"] = pick_flavor(self.client.flavors.list())
if "image" not in CACHE: if "image" not in CACHE:
CACHE["image"] = pick_image(self.glance.images.list()) CACHE["image"] = pick_image(self.openstack.image.images())
self.flavor = CACHE["flavor"] self.flavor = CACHE["flavor"]
self.image = CACHE["image"] self.image = CACHE["image"]

View File

@ -111,7 +111,7 @@ class TestServersBootNovaClient(base.ClientTestBase):
# get the snapshot image id out of the output table for the second # get the snapshot image id out of the output table for the second
# server create request # server create request
snapshot_id = self._get_value_from_the_table(snapshot_info, 'id') snapshot_id = self._get_value_from_the_table(snapshot_info, 'id')
self.addCleanup(self.glance.images.delete, snapshot_id) self.addCleanup(self.openstack.image.delete_image, snapshot_id)
# verify the metadata was set on the snapshot image # verify the metadata was set on the snapshot image
meta_value = self._get_value_from_the_table( meta_value = self._get_value_from_the_table(

View File

@ -5,7 +5,6 @@ ddt>=1.0.1 # MIT
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
python-keystoneclient>=3.8.0 # Apache-2.0 python-keystoneclient>=3.8.0 # Apache-2.0
python-cinderclient>=4.0.1 # Apache-2.0 python-cinderclient>=4.0.1 # Apache-2.0
python-glanceclient>=2.8.0 # Apache-2.0
python-neutronclient>=6.7.0 # Apache-2.0 python-neutronclient>=6.7.0 # Apache-2.0
requests-mock>=1.2.0 # Apache-2.0 requests-mock>=1.2.0 # Apache-2.0
openstacksdk>=0.11.2 # Apache-2.0 openstacksdk>=0.11.2 # Apache-2.0