Support ironicclient
Add ironicclient support into nmanager.py. Required for: blueprint ironic-ostf-tests Change-Id: I43994a9a5523c739db0d0cc65fa6b3adc3b224ad Co-Authored-by: Kyrylo Romanenko <kromanenko@mirantis.com>
This commit is contained in:
parent
c2e1fa0ca8
commit
47811b5f5e
|
@ -51,6 +51,10 @@ try:
|
|||
import glanceclient
|
||||
except Exception:
|
||||
LOG.warning('Glance client could not be imported')
|
||||
try:
|
||||
import ironicclient
|
||||
except Exception:
|
||||
LOG.warning('Ironic client could not be imported')
|
||||
|
||||
import cinderclient.client
|
||||
import glanceclient.client
|
||||
|
@ -105,6 +109,7 @@ class OfficialClientManager(fuel_health.manager.Manager):
|
|||
self.ceilometer_client = self._get_ceilometer_client()
|
||||
self.neutron_client = self._get_neutron_client()
|
||||
self.glance_client_v1 = self._get_glance_client(version=1)
|
||||
self.ironic_client = self._get_ironic_client()
|
||||
self.client_attr_names = [
|
||||
'compute_client',
|
||||
'identity_client',
|
||||
|
@ -116,7 +121,8 @@ class OfficialClientManager(fuel_health.manager.Manager):
|
|||
'murano_client',
|
||||
'sahara_client',
|
||||
'ceilometer_client',
|
||||
'neutron_client'
|
||||
'neutron_client',
|
||||
'ironic_client'
|
||||
]
|
||||
|
||||
def _get_compute_client(self, username=None, password=None,
|
||||
|
@ -316,6 +322,21 @@ class OfficialClientManager(fuel_health.manager.Manager):
|
|||
token=keystone.auth_token,
|
||||
endpoint_url=endpoint)
|
||||
|
||||
def _get_ironic_client(self, version='1'):
|
||||
keystone = self._get_identity_client()
|
||||
try:
|
||||
endpoint = keystone.service_catalog.url_for(
|
||||
service_type='baremetal',
|
||||
endpoint_type='internalURL')
|
||||
except keystoneclient.exceptions.EndpointNotFound:
|
||||
LOG.warning('Can not initialize ironic client')
|
||||
return None
|
||||
|
||||
return ironicclient.client.get_client(
|
||||
version,
|
||||
os_auth_token=keystone.auth_token,
|
||||
ironic_url=endpoint)
|
||||
|
||||
|
||||
class OfficialClientTest(fuel_health.test.TestCase):
|
||||
manager_class = OfficialClientManager
|
||||
|
|
|
@ -2,6 +2,7 @@ oslo.config>=1.2.1,<1.10.0
|
|||
|
||||
python-cinderclient>=1.0.7,<1.2.0
|
||||
python-ceilometerclient>=1.0.9,<1.0.15
|
||||
python-ironicclient>=0.3.3,<0.4.0
|
||||
python-keystoneclient>=0.11,<1.4.0
|
||||
python-muranoclient>=0.2.11,<0.6.0
|
||||
python-novaclient>=2.17.0,<2.24.0
|
||||
|
|
|
@ -21,6 +21,7 @@ Requires: python-argparse >= 1.2.1
|
|||
Requires: python-oslo-config >= 1.1.1
|
||||
Requires: python-ceilometerclient >= 1.0.9
|
||||
Requires: python-cinderclient >= 1.0.6
|
||||
Requires: python-ironicclient >= 0.3.3
|
||||
Requires: python-keystoneclient >= 0.11
|
||||
Requires: python-kombu >= 1:3.0.16
|
||||
Requires: python-novaclient >= 1:2.15.0
|
||||
|
|
Loading…
Reference in New Issue