aboutsummaryrefslogtreecommitdiffstats
path: root/sos/plugins/openstack_neutron.py
blob: bda9c5efd317de53e0d503cb3e5d27e13a73d4ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
## Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
## Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd <jshepher@rackspace.com>
## Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com>

### This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.

## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.

## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

import os

from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin


class OpenStackNeutron(Plugin):
    """openstack neutron related information
    """
    plugin_name = "openstack-neutron"

    option_list = [("log", "gathers openstack neutron logs", "slow", True)]

    def setup(self):
        self.add_copy_specs(["/etc/neutron/"])

        if self.option_enabled("log"):
            self.add_copy_specs(["/var/log/neutron/"])


class DebianOpenStackNeutron(OpenStackNeutron, DebianPlugin, UbuntuPlugin):
    """OpenStack Neutron related information for Debian based distributions
    """

    neutron = False
    packages = ('neutron-common',
                'neutron-plugin-cisco',
                'neutron-plugin-linuxbridge-agent',
                'neutron-plugin-nicira',
                'neutron-plugin-openvswitch',
                'neutron-plugin-openvswitch-agent',
                'neutron-plugin-ryu',
                'neutron-plugin-ryu-agent',
                'neutron-server',
                'python-neutron',
                'python-neutronclient')

    def check_enabled(self):
        self.neutron = self.is_installed("neutron-common")
        return self.neutron

    def setup(self):
        super(DebianOpenStackNeutron, self).setup()
        self.add_copy_specs(["/etc/sudoers.d/neutron_sudoers"])


class RedHatOpenStackNeutron(OpenStackNeutron, RedHatPlugin):
    """OpenStack Neutron related information for Red Hat distributions
    """

    neutron = False
    packages = ('openstack-neutron-bigswitch',
                'openstack-neutron-brocade',
                'openstack-neutron-cisco',
                'openstack-neutron-hyperv',
                'openstack-neutron-linuxbridge',
                'openstack-neutron-metaplugin',
                'openstack-neutron-midonet',
                'openstack-neutron-nec',
                'openstack-neutron-nicira',
                'openstack-neutron-openvswitch',
                'openstack-neutron-plumgrid',
                'openstack-neutron-ryu',
                'python-neutron',
                'python-neutronclient',
                'openstack-neutron')

    def check_enabled(self):
        self.neutron = self.is_installed("openstack-neutron")
        return self.neutron

    def setup(self):
        super(RedHatOpenStackNeutron, self).setup()

# vim: et ts=4 sw=4