diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-04-14 19:56:41 +0100 |
---|---|---|
committer | Pep Turro Mauri <pep@redhat.com> | 2014-06-26 22:19:07 +0200 |
commit | fc4f832dc46aa74312761a6b2172d5e0a8f9f68d (patch) | |
tree | df19b6fbc8922bb35e020234cafd0372d7c29280 | |
parent | e2a443210a3d84569ae9930c7a932fadb30d9596 (diff) | |
download | sos-fc4f832dc46aa74312761a6b2172d5e0a8f9f68d.tar.gz |
Make OpenShift broker vs. node detection automatic
Enable broker and node data collection by detecting the respective
configuration files and automatically collect files and command
output for the components present.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/openshift.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sos/plugins/openshift.py b/sos/plugins/openshift.py index d032b27e..a90702f1 100644 --- a/sos/plugins/openshift.py +++ b/sos/plugins/openshift.py @@ -13,18 +13,28 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin +import os.path class Openshift(Plugin, RedHatPlugin): '''Openshift related information''' plugin_name = "openshift" + # The 'broker' and 'node' options are obsolete but are maintained + # here for compatibility with external programs that call sosreport + # with these names. option_list = [("broker", "Gathers broker specific files", "slow", False), ("node", "Gathers node specific files", "slow", False)] ruby = "ruby193" vendor ="rh" + def is_broker(self): + return os.path.exists("/etc/openshift/broker.conf") + + def is_node(self): + return os.path.exists("/etc/openshift/node.conf") + def setup(self): self.add_copy_specs([ "/etc/openshift-enterprise-version", @@ -34,7 +44,7 @@ class Openshift(Plugin, RedHatPlugin): self.add_cmd_output("oo-diagnostics") - if self.option_enabled("broker"): + if self.is_broker() self.add_copy_specs([ "/var/log/mcollective-client.log", "/var/log/openshift/broker/", @@ -50,8 +60,7 @@ class Openshift(Plugin, RedHatPlugin): runat = '/var/www/openshift/broker/' self.add_cmd_output("bundle --local", runat) - - if self.option_enabled("node"): + if self.is_node() self.add_copy_specs([ "/var/log/openshift/node", "/cgroup/*/openshift/", |