aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Dobrelya <bdobreli@redhat.com>2022-03-04 11:36:14 +0100
committerJake Hunsaker <jhunsake@redhat.com>2022-03-24 09:53:11 -0400
commit382daef525564607428445e8dcfd1b5aa5b7869c (patch)
treeb7b7d763d7e2faa8c024abd4edb1ef23c55d7379
parent298e1ec1f2b590bd55feb1a0019f49eb14368575 (diff)
downloadsos-382daef525564607428445e8dcfd1b5aa5b7869c.tar.gz
[openstack_nova] Collect containerized metadata logs
Update the openstack plugin to collect nova metadata logs Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
-rw-r--r--sos/report/plugins/openstack_nova.py60
1 files changed, 28 insertions, 32 deletions
diff --git a/sos/report/plugins/openstack_nova.py b/sos/report/plugins/openstack_nova.py
index f840081e..0d556527 100644
--- a/sos/report/plugins/openstack_nova.py
+++ b/sos/report/plugins/openstack_nova.py
@@ -15,6 +15,7 @@
from sos.report.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
import os
+import re
class OpenStackNova(Plugin):
@@ -98,6 +99,7 @@ class OpenStackNova(Plugin):
"nova-api.log*",
"nova-compute.log*",
"nova-conductor.log*",
+ "nova-metadata-api.log*",
"nova-manage.log*",
"nova-placement-api.log*",
"nova-scheduler.log*"
@@ -105,42 +107,36 @@ class OpenStackNova(Plugin):
for novalog in novalogs:
self.add_copy_spec(self.path_join(novadir, novalog))
- self.add_copy_spec([
+ pp = ['', '_libvirt', '_metadata', '_placement']
+ sp = [
+ '/etc/nova/',
+ '/etc/my.cnf.d/tripleo.cnf',
+ '/etc/httpd/conf/',
+ '/etc/httpd/conf.d/',
+ '/etc/httpd/conf.modules.d/*.conf'
+ ]
+ # excludes httpd'ish specs in the libvirt path
+ specs = [
"/etc/nova/",
- self.var_puppet_gen + "/etc/nova/",
- self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf",
- self.var_puppet_gen + "/var/spool/cron/nova",
- self.var_puppet_gen + "/etc/httpd/conf/",
- self.var_puppet_gen + "/etc/httpd/conf.d/",
- self.var_puppet_gen + "/etc/httpd/conf.modules.d/*.conf",
- self.var_puppet_gen + "_placement/etc/nova/",
- self.var_puppet_gen + "_placement/etc/httpd/conf/",
- self.var_puppet_gen + "_placement/etc/httpd/conf.d/",
- self.var_puppet_gen + "_placement/etc/httpd/conf.modules.d/*.conf",
- self.var_puppet_gen + "_placement/etc/my.cnf.d/tripleo.cnf",
+ "authorized_keys",
self.var_puppet_gen + "/../memcached/etc/sysconfig/memcached",
+ self.var_puppet_gen + "/var/spool/cron/nova",
self.var_puppet_gen + "_libvirt/etc/libvirt/",
- self.var_puppet_gen + "_libvirt/etc/my.cnf.d/tripleo.cnf",
- self.var_puppet_gen + "_libvirt/etc/nova/",
- self.var_puppet_gen + "_libvirt/etc/nova/migration/"
- "authorized_keys",
- self.var_puppet_gen + "_libvirt/var/lib/nova/.ssh/config",
- ])
+ self.var_puppet_gen + "_libvirt/etc/nova/migration/",
+ self.var_puppet_gen + "_libvirt/var/lib/nova/.ssh/config"
+ ] + list(
+ filter(re.compile('^((?!libvirt.+httpd).)*$').match,
+ ['%s%s%s' % (
+ self.var_puppet_gen, p, s) for p in pp for s in sp
+ ]))
+ self.add_copy_spec(specs)
def apply_regex_sub(self, regexp, subst):
self.do_path_regex_sub("/etc/nova/*", regexp, subst)
- self.do_path_regex_sub(
- self.var_puppet_gen + "/etc/nova/*",
- regexp, subst
- )
- self.do_path_regex_sub(
- self.var_puppet_gen + "_placement/etc/nova/*",
- regexp, subst
- )
- self.do_path_regex_sub(
- self.var_puppet_gen + "_libvirt/etc/nova/*",
- regexp, subst
- )
+ for p in ['', '_libvirt', '_metadata', '_placement']:
+ self.do_path_regex_sub(
+ "%s%s/etc/nova/*" % (self.var_puppet_gen, p),
+ regexp, subst)
def postproc(self):
protect_keys = [
@@ -216,12 +212,12 @@ class RedHatNova(OpenStackNova, RedHatPlugin):
])
if self.get_option("all_logs"):
self.add_copy_spec([
- "/var/log/httpd/nova_api*",
+ "/var/log/httpd/nova*",
"/var/log/httpd/placement*",
])
else:
self.add_copy_spec([
- "/var/log/httpd/nova_api*.log",
+ "/var/log/httpd/nova*.log",
"/var/log/httpd/placement*.log",
])