Add zaqarclient to TripleOAction
In order to allow sending messages to zaqar queue we need to provide Zaqar client in TripleOAction. Cherry pick from: I2378e3626a415fd0cdf085735a4ed890e6aa61f4 Change-Id: I2378e3626a415fd0cdf085735a4ed890e6aa61f4
This commit is contained in:
parent
37f3f455d4
commit
6325cfa3fb
@ -24,3 +24,4 @@ passlib>=1.7.0 # BSD
|
||||
netifaces>=0.10.4 # MIT
|
||||
paramiko>=2.0 # LGPLv2.1+
|
||||
netaddr!=0.7.16,>=0.7.13 # BSD
|
||||
python-zaqarclient>=1.0.0 # Apache-2.0
|
||||
|
@ -24,6 +24,7 @@ from mistralclient.api import client as mistral_client
|
||||
from novaclient.client import Client as nova_client
|
||||
from swiftclient import client as swift_client
|
||||
from swiftclient import exceptions as swiftexceptions
|
||||
from zaqarclient.queues.v2 import client as zaqarclient
|
||||
|
||||
from tripleo_common import constants
|
||||
from tripleo_common.utils import keystone as keystone_utils
|
||||
@ -105,6 +106,23 @@ class TripleOAction(actions.Action):
|
||||
username=context.user_name
|
||||
)
|
||||
|
||||
def get_messaging_client(self, context):
|
||||
zaqar_endpoint = keystone_utils.get_endpoint_for_project(
|
||||
context, service_type='messaging')
|
||||
keystone_endpoint = keystone_utils.get_endpoint_for_project(
|
||||
context, 'keystone')
|
||||
|
||||
opts = {
|
||||
'os_auth_token': context.auth_token,
|
||||
'os_auth_url': keystone_endpoint.url,
|
||||
'os_project_id': context.project_id,
|
||||
'insecure': context.insecure,
|
||||
}
|
||||
auth_opts = {'backend': 'keystone', 'options': opts}
|
||||
conf = {'auth_opts': auth_opts}
|
||||
|
||||
return zaqarclient.Client(zaqar_endpoint.url, conf=conf)
|
||||
|
||||
def get_workflow_client(self, context):
|
||||
mistral_endpoint = keystone_utils.get_endpoint_for_project(
|
||||
context, 'mistral')
|
||||
|
Loading…
Reference in New Issue
Block a user