summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-01-07 21:36:25 +0000
committerGerrit Code Review <review@openstack.org>2020-01-07 21:36:25 +0000
commit1df8756ccc504f8ed481178a770079cf7a5352e5 (patch)
tree8abbd1af5fc14f70a5acb210598db17efdeeb54a
parent5e5d97c2b3b02ef418cbc023f8fdae242a549112 (diff)
parentab584e500e08f2f22e120e327908ecee9536719d (diff)
downloadheat-1df8756ccc504f8ed481178a770079cf7a5352e5.tar.gz
Merge "Added a Vitrage client"
-rw-r--r--README.rst1
-rw-r--r--heat/common/config.py2
-rw-r--r--heat/engine/clients/os/vitrage.py30
-rw-r--r--heat/tests/clients/test_vitrage_client.py24
-rw-r--r--lower-constraints.txt1
-rw-r--r--releasenotes/notes/add-vitrage-client-plugin-cb9e6b51ec2cc6ec.yaml4
-rw-r--r--requirements.txt1
-rw-r--r--setup.cfg1
8 files changed, 63 insertions, 1 deletions
diff --git a/README.rst b/README.rst
index b3a646dca..10ec06dff 100644
--- a/README.rst
+++ b/README.rst
@@ -75,3 +75,4 @@ We have integration with
* https://opendev.org/openstack/python-blazarclient (reservation service)
* https://opendev.org/openstack/python-octaviaclient.git (Load-balancer service)
* https://opendev.org/openstack/python-senlinclient (Clustering service)
+* https://opendev.org/openstack/python-vitrageclient.git (RCA service)
diff --git a/heat/common/config.py b/heat/common/config.py
index 92140824c..252e0d54a 100644
--- a/heat/common/config.py
+++ b/heat/common/config.py
@@ -448,7 +448,7 @@ def list_opts():
for client in ('aodh', 'barbican', 'cinder', 'designate',
'glance', 'heat', 'keystone', 'magnum', 'manila', 'mistral',
'monasca', 'neutron', 'nova', 'octavia', 'sahara', 'senlin',
- 'swift', 'trove', 'zaqar'
+ 'swift', 'trove', 'vitrage', 'zaqar'
):
client_specific_group = 'clients_' + client
yield client_specific_group, clients_opts
diff --git a/heat/engine/clients/os/vitrage.py b/heat/engine/clients/os/vitrage.py
new file mode 100644
index 000000000..c51b5f2f2
--- /dev/null
+++ b/heat/engine/clients/os/vitrage.py
@@ -0,0 +1,30 @@
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from heat.engine.clients import client_plugin
+from oslo_log import log as logging
+from vitrageclient import client as vitrage_client
+
+LOG = logging.getLogger(__name__)
+
+CLIENT_NAME = 'vitrage'
+
+
+class VitrageClientPlugin(client_plugin.ClientPlugin):
+
+ exceptions_module = None
+
+ service_types = [RCA] = ['rca']
+
+ def _create(self):
+ return vitrage_client.Client('1', self.context.keystone_session)
diff --git a/heat/tests/clients/test_vitrage_client.py b/heat/tests/clients/test_vitrage_client.py
new file mode 100644
index 000000000..8e9c46b07
--- /dev/null
+++ b/heat/tests/clients/test_vitrage_client.py
@@ -0,0 +1,24 @@
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from heat.tests import common
+from heat.tests import utils
+
+
+class VitrageClientPluginTest(common.HeatTestCase):
+
+ def test_create(self):
+ context = utils.dummy_context()
+ plugin = context.clients.client_plugin('vitrage')
+ client = plugin.client()
+ self.assertIsNotNone(client.template.list)
diff --git a/lower-constraints.txt b/lower-constraints.txt
index b0678d3db..8fdc81b18 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -124,6 +124,7 @@ python-saharaclient==1.4.0
python-subunit==1.2.0
python-swiftclient==3.2.0
python-troveclient==2.2.0
+python-vitrageclient==2.7.0
python-zaqarclient==1.3.0
python-zunclient==3.4.0
pytz==2013.6
diff --git a/releasenotes/notes/add-vitrage-client-plugin-cb9e6b51ec2cc6ec.yaml b/releasenotes/notes/add-vitrage-client-plugin-cb9e6b51ec2cc6ec.yaml
new file mode 100644
index 000000000..e86394e81
--- /dev/null
+++ b/releasenotes/notes/add-vitrage-client-plugin-cb9e6b51ec2cc6ec.yaml
@@ -0,0 +1,4 @@
+---
+features:
+ - Introduce a Vitrage client plugin module that will be used by the
+ Vitrage resources.
diff --git a/requirements.txt b/requirements.txt
index 656bfaca2..e0109c9d4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -50,6 +50,7 @@ python-openstackclient>=3.12.0 # Apache-2.0
python-saharaclient>=1.4.0 # Apache-2.0
python-swiftclient>=3.2.0 # Apache-2.0
python-troveclient>=2.2.0 # Apache-2.0
+python-vitrageclient>=2.7.0 # Apache-2.0
python-zaqarclient>=1.3.0 # Apache-2.0
python-zunclient>=3.4.0 # Apache-2.0
pytz>=2013.6 # MIT
diff --git a/setup.cfg b/setup.cfg
index c8bb011db..8301eab12 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -86,6 +86,7 @@ heat.clients =
senlin = heat.engine.clients.os.senlin:SenlinClientPlugin
swift = heat.engine.clients.os.swift:SwiftClientPlugin
trove = heat.engine.clients.os.trove:TroveClientPlugin
+ vitrage = heat.engine.clients.os.vitrage:VitrageClientPlugin
zaqar = heat.engine.clients.os.zaqar:ZaqarClientPlugin
zun = heat.engine.clients.os.zun:ZunClientPlugin