Merge "Rename marconi to zaqar"

This commit is contained in:
Jenkins 2014-08-27 09:31:35 +00:00 committed by Gerrit Code Review
commit 6016de7ab4
6 changed files with 50 additions and 50 deletions

View File

@ -727,21 +727,6 @@
#hash_algorithms=md5
[marconi_client]
#
# Options defined in solum.common.clients
#
# Type of endpoint in Queue service catalog to use for
# communication with the Marconi service. (string value)
#endpoint_type=publicURL
# If set, then the server's certificate for marconi will not
# be verified. (boolean value)
#insecure=false
[matchmaker_ring]
#
@ -829,3 +814,18 @@
#task_log_dir=/var/log/solum/worker
[zaqar_client]
#
# Options defined in solum.common.clients
#
# Type of endpoint in Queue service catalog to use for
# communication with the Zaqar service. (string value)
#endpoint_type=publicURL
# If set, then the server's certificate for zaqar will not be
# verified. (boolean value)
#insecure=false

View File

@ -10,7 +10,7 @@ pbr>=0.6,!=0.7,<1.0
pecan>=0.5.0
python-glanceclient>=0.13.1
python-heatclient>=0.2.9
python-marconiclient>=0.0.2
python-zaqarclient>=0.0.3
python-neutronclient>=2.3.5,<3
python-keystoneclient>=0.9.0
python-swiftclient>=2.0.2

View File

@ -49,7 +49,7 @@ class InfrastructureStackHandler(handler.Handler):
def create(self, data):
"""Create a new stack.
Create a new infrastructure stack by using Heat. Note that a marconi
Create a new infrastructure stack by using Heat. Note that a zaqar
queue is created and will be consumed by solum-infra-guestagent.
"""
db_obj = objects.registry.InfrastructureStack()
@ -58,15 +58,15 @@ class InfrastructureStackHandler(handler.Handler):
db_obj.user_id = self.context.user
db_obj.project_id = self.context.tenant
self._create_marconi_queue(db_obj.uuid)
self._create_zaqar_queue(db_obj.uuid)
db_obj.heat_stack_id = self._deploy_infra(data.get('image_id'))
db_obj.create(self.context)
return db_obj
def _create_marconi_queue(self, queue_name):
def _create_zaqar_queue(self, queue_name):
osc = clients.OpenStackClients(self.context)
osc.marconi().queue(queue_name)
osc.zaqar().queue(queue_name)
def _deploy_infra(self, image_id):
osc = clients.OpenStackClients(self.context)

View File

@ -14,11 +14,11 @@
from glanceclient import client as glanceclient
from heatclient import client as heatclient
from marconiclient.queues.v1 import client as marconiclient
from mistralclient.api import client as mistralclient
from neutronclient.neutron import client as neutronclient
from oslo.config import cfg
from swiftclient import client as swiftclient
from zaqarclient.queues.v1 import client as zaqarclient
from solum.common import exception
from solum.common import solum_keystoneclient
@ -59,15 +59,15 @@ heat_client_opts = [
help=_("If set, then the server's certificate will not "
"be verified."))]
marconi_client_opts = [
zaqar_client_opts = [
cfg.StrOpt('endpoint_type',
default='publicURL',
help=_(
'Type of endpoint in Queue service catalog to use '
'for communication with the Marconi service.')),
'for communication with the Zaqar service.')),
cfg.BoolOpt('insecure',
default=False,
help=_("If set, then the server's certificate for marconi "
help=_("If set, then the server's certificate for zaqar "
"will not be verified."))]
neutron_client_opts = [
@ -111,7 +111,7 @@ mistral_client_opts = [
cfg.CONF.register_opts(glance_client_opts, group='glance_client')
cfg.CONF.register_opts(heat_client_opts, group='heat_client')
cfg.CONF.register_opts(marconi_client_opts, group='marconi_client')
cfg.CONF.register_opts(zaqar_client_opts, group='zaqar_client')
cfg.CONF.register_opts(neutron_client_opts, group='neutron_client')
cfg.CONF.register_opts(swift_client_opts, group='swift_client')
cfg.CONF.register_opts(mistral_client_opts, group='mistral_client')
@ -127,7 +127,7 @@ class OpenStackClients(object):
self._heat = None
self._neutron = None
self._swift = None
self._marconi = None
self._zaqar = None
self._mistral = None
def url_for(self, **kwargs):
@ -149,11 +149,11 @@ class OpenStackClients(object):
return self._keystone
@exception.wrap_keystone_exception
def marconi(self):
if self._marconi:
return self._marconi
def zaqar(self):
if self._zaqar:
return self._zaqar
endpoint_type = self._get_client_option('marconi', 'endpoint_type')
endpoint_type = self._get_client_option('zaqar', 'endpoint_type')
endpoint_url = self.url_for(service_type='queuing',
endpoint_type=endpoint_type)
conf = {'auth_opts':
@ -161,11 +161,11 @@ class OpenStackClients(object):
'options': {'os_auth_token': self.auth_token,
'os_auth_url': self.auth_url,
'insecure': self._get_client_option(
'marconi', 'insecure')}
'zaqar', 'insecure')}
}
}
self._marconi = marconiclient.Client(endpoint_url, conf=conf)
return self._marconi
self._zaqar = zaqarclient.Client(endpoint_url, conf=conf)
return self._zaqar
@exception.wrap_keystone_exception
def neutron(self):

View File

@ -73,7 +73,7 @@ class TestInfrastructureStackHandler(base.BaseTestCase):
mock_create.return_value = {"stack": {"id": "fake_id",
"links": [{"href": "http://fake.ref",
"rel": "self"}]}}
mock_queue = mock_clients.return_value.marconi.return_value.queue
mock_queue = mock_clients.return_value.zaqar.return_value.queue
handler = infra.InfrastructureStackHandler(self.ctx)
res = handler.create(data)
db_obj.update.assert_called_once_with(data)
@ -85,11 +85,11 @@ class TestInfrastructureStackHandler(base.BaseTestCase):
mock_queue.assert_called_once_with(db_obj.uuid)
@mock.patch('solum.common.clients.OpenStackClients')
def test_create_marconi_queue(self, mock_clients, mock_registry):
def test_create_zaqar_queue(self, mock_clients, mock_registry):
queue_name = 'test'
mock_queue = mock_clients.return_value.marconi.return_value.queue
mock_queue = mock_clients.return_value.zaqar.return_value.queue
handler = infra.InfrastructureStackHandler(self.ctx)
handler._create_marconi_queue(queue_name)
handler._create_zaqar_queue(queue_name)
mock_queue.assert_called_once_with(queue_name)
def test_delete(self, mock_registry):

View File

@ -12,11 +12,11 @@
from glanceclient import client as glanceclient
from heatclient import client as heatclient
from marconiclient.queues.v1 import client as marconiclient
from mistralclient.api import client as mistralclient
import mock
from neutronclient.neutron import client as neutronclient
from swiftclient import client as swiftclient
from zaqarclient.queues.v1 import client as zaqarclient
from solum.common import clients
from solum.common import exception
@ -248,10 +248,10 @@ class ClientsTest(base.BaseTestCase):
mistral_cached = obj.mistral()
self.assertEqual(mistral, mistral_cached)
@mock.patch.object(marconiclient, 'Client')
@mock.patch.object(zaqarclient, 'Client')
@mock.patch.object(clients.OpenStackClients, 'url_for')
@mock.patch.object(clients.OpenStackClients, 'auth_url')
def test_clients_marconi(self, mock_auth, mock_url, mock_call):
def test_clients_zaqar(self, mock_auth, mock_url, mock_call):
mock_auth.__get__ = mock.Mock(return_value="keystone_url")
con = mock.MagicMock()
con.tenant = "b363706f891f48019483f8bd6503c54b"
@ -259,8 +259,8 @@ class ClientsTest(base.BaseTestCase):
con.auth_url = "keystone_url"
mock_url.return_value = "url_from_keystone"
obj = clients.OpenStackClients(con)
obj._marconi = None
obj.marconi()
obj._zaqar = None
obj.zaqar()
conf = {'auth_opts':
{'backend': 'keystone',
'options':
@ -271,7 +271,7 @@ class ClientsTest(base.BaseTestCase):
}
mock_call.assert_called_once_with('url_from_keystone', conf=conf)
def test_clients_marconi_noauth(self):
def test_clients_zaqar_noauth(self):
con = mock.MagicMock()
con.auth_token = None
con.auth_token_info = None
@ -282,19 +282,19 @@ class ClientsTest(base.BaseTestCase):
con.get_url_for = mock.Mock(name="get_url_for")
con.get_url_for.return_value = "url_from_keystone"
obj = clients.OpenStackClients(con)
obj._marconi = None
self.assertRaises(exception.AuthorizationFailure, obj.marconi)
obj._zaqar = None
self.assertRaises(exception.AuthorizationFailure, obj.zaqar)
@mock.patch.object(clients.OpenStackClients, 'url_for')
@mock.patch.object(clients.OpenStackClients, 'auth_url')
def test_clients_marconi_cached(self, mock_auth, mock_url):
def test_clients_zaqar_cached(self, mock_auth, mock_url):
mock_auth.__get__ = mock.Mock(return_value="keystone_url")
con = mock.MagicMock()
con.tenant = "b363706f891f48019483f8bd6503c54b"
con.auth_token = "3bcc3d3a03f44e3d8377f9247b0ad155"
mock_url.return_value = "url_from_keystone"
obj = clients.OpenStackClients(con)
obj._marconi = None
marconi = obj.marconi()
marconi_cached = obj.marconi()
self.assertEqual(marconi, marconi_cached)
obj._zaqar = None
zaqar = obj.zaqar()
zaqar_cached = obj.zaqar()
self.assertEqual(zaqar, zaqar_cached)