Fix fake clients in actions
* Use inspector_url when creating a fake client for ironic inspector client * Add a session and a url for designate fake client Change-Id: I9cc78df13d0f0715538bbdb76c8ccad273bd2033
This commit is contained in:
parent
da93da4ac1
commit
eaf0916e31
|
@ -374,25 +374,7 @@ class BaremetalIntrospectionAction(base.OpenStackAction):
|
|||
|
||||
@classmethod
|
||||
def _get_fake_client(cls):
|
||||
try:
|
||||
# ironic-inspector client tries to get and validate it's own
|
||||
# version when created. This might require checking the keystone
|
||||
# catalog if the ironic-inspector server is not listening on the
|
||||
# localhost IP address. Thus, we get a session for this case.
|
||||
sess = keystone_utils.get_admin_session()
|
||||
|
||||
return cls._get_client_class()(session=sess)
|
||||
except Exception as e:
|
||||
LOG.warning("There was an error trying to create the "
|
||||
"ironic-inspector client using a session: %s", str(e))
|
||||
# If it's not possible to establish a keystone session, attempt to
|
||||
# create a client without it. This should fall back to where the
|
||||
# ironic-inspector client tries to get it's own version on the
|
||||
# default IP address.
|
||||
LOG.debug("Attempting to create the ironic-inspector client "
|
||||
"without a session.")
|
||||
|
||||
return cls._get_client_class()()
|
||||
return cls._get_client_class()(inspector_url='http://127.0.0.1')
|
||||
|
||||
def _create_client(self, context):
|
||||
LOG.debug(
|
||||
|
@ -730,7 +712,11 @@ class DesignateAction(base.OpenStackAction):
|
|||
|
||||
@classmethod
|
||||
def _get_fake_client(cls):
|
||||
return cls._get_client_class()()
|
||||
session = keystone_utils.get_admin_session()
|
||||
return cls._get_client_class()(
|
||||
endpoint_override="http://127.0.0.1:9001/",
|
||||
session=session
|
||||
)
|
||||
|
||||
|
||||
class MagnumAction(base.OpenStackAction):
|
||||
|
|
|
@ -1059,36 +1059,23 @@
|
|||
},
|
||||
"designate": {
|
||||
"_comment": "It uses designateclient.v2.",
|
||||
"diagnostics_ping": "diagnostics.ping",
|
||||
"domains_create ": "domains.create",
|
||||
"domains_delete": "domains.delete",
|
||||
"domains_get": "domains.get",
|
||||
"domains_list": "domains.list",
|
||||
"domains_list_domain_servers": "domains.list_domain_servers",
|
||||
"domains_update": "domains.update",
|
||||
"quotas_get": "quotas.get",
|
||||
"quotas_list": "quotas.list",
|
||||
"quotas_reset": "quotas.reset",
|
||||
"quotas_update": "quotas.update",
|
||||
"records_create": "records.create",
|
||||
"records_delete": "records.delete",
|
||||
"records_get": "records.get",
|
||||
"records_list": "records.list",
|
||||
"records_update": "records.update",
|
||||
"reports_count_all": "reports.count_all",
|
||||
"reports_count_domains": "reports.count_domains",
|
||||
"reports_count_records": "reports.count_records",
|
||||
"reports_count_tenants": "reports.count_tenants",
|
||||
"reports_tenant_domains": "reports.tenant_domains",
|
||||
"reports_tenants_all": "reports.tenants_all",
|
||||
"servers_create": "servers.create",
|
||||
"servers_delete": "servers.delete",
|
||||
"servers_get": "servers.get",
|
||||
"servers_list": "servers.list",
|
||||
"servers_update": "servers.update",
|
||||
"sync_sync_all": "sync.sync_all",
|
||||
"sync_sync_domain": "sync.sync_domain",
|
||||
"sync_sync_record": "sync.sync_record",
|
||||
"touch_domain": "touch.domain"
|
||||
"recordset_create": "recordsets.create",
|
||||
"recordset_delete": "recordsets.delete",
|
||||
"recordset_get": "recordsets.get",
|
||||
"recordset_list": "recordsets.list",
|
||||
"recordset_list_all_zones": "recordsets.list_all_zones",
|
||||
"recordset_update": "recordsets.update",
|
||||
"nameservers_list": "nameservers.list",
|
||||
"pools_list": "pools.list",
|
||||
"limits_get": "limits.get",
|
||||
"blacklists_create": "blacklists.create",
|
||||
"blacklists_get": "blacklists.get",
|
||||
"blacklists_list": "blacklists.list",
|
||||
"blacklists_update": "blacklists.update",
|
||||
"blacklists_delete": "blacklists.delete"
|
||||
},
|
||||
"magnum": {
|
||||
"_comment": "It uses magnumclient.v1.",
|
||||
|
|
|
@ -47,7 +47,7 @@ MODULE_MAPPING = {
|
|||
'zaqar': ['zaqar.queue_messages', actions.ZaqarAction],
|
||||
'barbican': ['barbican.orders_list', actions.BarbicanAction],
|
||||
'mistral': ['mistral.workflows_get', actions.MistralAction],
|
||||
'designate': ['designate.domains_list', actions.DesignateAction],
|
||||
'designate': ['designate.quotas_list', actions.DesignateAction],
|
||||
'manila': ['manila.shares_list', actions.ManilaAction],
|
||||
'magnum': ['magnum.bays_list', actions.MagnumAction],
|
||||
'murano': ['murano.deployments_list', actions.MuranoAction],
|
||||
|
|
Loading…
Reference in New Issue