aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johnston <chris.johnston@canonical.com>2020-01-29 20:20:14 +0000
committerBryan Quigley <bryan.quigley@canonical.com>2020-02-07 13:57:22 -0800
commit4a77a4a872fd7b9defdda2fc8b6c65f5dde9247e (patch)
treeb7d486dc87b3b5f9eaf087129a7a36e2f5fe2b39
parentcae33b5962a2a210e82f429247eadb67696fd91d (diff)
downloadsos-4a77a4a872fd7b9defdda2fc8b6c65f5dde9247e.tar.gz
[gnocchi] Add support for Debian and Ubuntu.
Adds Gnocchi plugin support for Debian and Ubuntu. Fixes: #1927 Resolves: #1929 Signed-off-by: Chris Johnston <chris.johnston@canonical.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
-rw-r--r--sos/plugins/gnocchi.py62
1 files changed, 44 insertions, 18 deletions
diff --git a/sos/plugins/gnocchi.py b/sos/plugins/gnocchi.py
index 988cf89b..2c24534e 100644
--- a/sos/plugins/gnocchi.py
+++ b/sos/plugins/gnocchi.py
@@ -10,44 +10,31 @@
# See the LICENSE file in the source distribution for further information.
import os
-from sos.plugins import Plugin, RedHatPlugin
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
-class GnocchiPlugin(Plugin, RedHatPlugin):
+class Gnocchi(Plugin):
"""Gnocchi - Metric as a service"""
plugin_name = "gnocchi"
profiles = ('openstack', 'openstack_controller')
- packages = (
- 'openstack-gnocchi-metricd', 'openstack-gnocchi-common',
- 'openstack-gnocchi-statsd', 'openstack-gnocchi-api',
- 'openstack-gnocchi-carbonara'
- )
-
requires_root = False
- var_puppet_gen = "/var/lib/config-data/puppet-generated/gnocchi"
-
def setup(self):
self.add_copy_spec([
"/etc/gnocchi/*",
- self.var_puppet_gen + "/etc/gnocchi/*",
- self.var_puppet_gen + "/etc/httpd/conf/*",
- self.var_puppet_gen + "/etc/httpd/conf.d/*",
- self.var_puppet_gen + "/etc/httpd/conf.modules.d/wsgi.conf",
- self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf"
])
if self.get_option("all_logs"):
self.add_copy_spec([
"/var/log/gnocchi/*",
- "/var/log/httpd/gnocchi*",
+ "/var/log/{}*/gnocchi*".format(self.apachepkg)
])
else:
self.add_copy_spec([
"/var/log/gnocchi/*.log",
- "/var/log/httpd/gnocchi*.log",
+ "/var/log/{}*/gnocchi*.log".format(self.apachepkg)
])
vars_all = [p in os.environ for p in [
@@ -73,9 +60,39 @@ class GnocchiPlugin(Plugin, RedHatPlugin):
def postproc(self):
self.do_file_sub(
"/etc/gnocchi/gnocchi.conf",
- r"password=(.*)",
+ r"ceph_secret\s?=(.*)",
+ r"ceph_secret=*****",
+ )
+ self.do_file_sub(
+ "/etc/gnocchi/gnocchi.conf",
+ r"password\s?=(.*)",
r"password=*****",
)
+
+
+class RedHatGnocchi(Gnocchi, RedHatPlugin):
+
+ apachepkg = 'httpd'
+ var_puppet_gen = "/var/lib/config-data/puppet-generated/gnocchi"
+
+ packages = (
+ 'openstack-gnocchi-metricd', 'openstack-gnocchi-common',
+ 'openstack-gnocchi-statsd', 'openstack-gnocchi-api',
+ 'openstack-gnocchi-carbonara'
+ )
+
+ def setup(self):
+ super(RedHatGnocchi, self).setup()
+ self.add_copy_spec([
+ self.var_puppet_gen + "/etc/gnocchi/*",
+ self.var_puppet_gen + "/etc/httpd/conf/*",
+ self.var_puppet_gen + "/etc/httpd/conf.d/*",
+ self.var_puppet_gen + "/etc/httpd/conf.modules.d/wsgi.conf",
+ self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf"
+ ])
+
+ def postproc(self):
+ super(RedHatGnocchi, self).postproc()
self.do_file_sub(
self.var_puppet_gen + "/etc/gnocchi/"
"gnocchi.conf",
@@ -84,4 +101,13 @@ class GnocchiPlugin(Plugin, RedHatPlugin):
)
+class DebianGnocchi(Gnocchi, DebianPlugin, UbuntuPlugin):
+
+ apachepkg = 'apache'
+
+ packages = (
+ 'gnocchi-api', 'gnocchi-metricd', 'gnocchi-common'
+ 'gnocchi-statsd', 'python3-gnocchiclient'
+ )
+
# vim: set et ts=4 sw=4 :