From 7af1da54b84ddd3ef82f90d86358f2038db5cb9e Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Thu, 7 Nov 2013 17:28:30 +0000 Subject: Fix foreman and katello for sos-3.x The foreman and katello plug-ins committed in 4650d3f use the sos-2.2 APIs and class names. This breaks sos since the plug-ins will not load under 3.0. Fix up the modules to use the new names and API conventions and ensure that they load correctly. Signed-off-by: Bryn M. Reeves --- sos/plugins/foreman.py | 21 ++++++++------------- sos/plugins/katello.py | 21 ++++++++------------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/sos/plugins/foreman.py b/sos/plugins/foreman.py index 60ec34df..28ea6a24 100644 --- a/sos/plugins/foreman.py +++ b/sos/plugins/foreman.py @@ -14,23 +14,18 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import sos.plugintools import os +from sos.plugins import Plugin, RedHatPlugin -class foreman(sos.plugintools.PluginBase): +class Foreman(Plugin, RedHatPlugin): """Foreman project related information """ - def defaultenabled(self): - return True - - def checkenabled(self): - self.packages = ["foreman"] - self.files = ["/usr/sbin/foreman-debug"] - return sos.plugintools.PluginBase.checkenabled(self) + plugin_name = 'foreman' + packages = ('foreman') def setup(self): - foreman_debug = "/usr/sbin/foreman-debug" - if os.path.isfile(foreman_debug): - foreman_debug_path = os.path.join(self.cInfo['dstroot'],"foreman-debug") - self.collectExtOutput("%s -a -d %s" % (foreman_debug, foreman_debug_path)) + foreman_debug_path = os.path.join( + self.get_cmd_path(),"foreman-debug") + self.add_cmd_output("%s -a -d %s" + % ("foreman-debug", foreman_debug_path)) diff --git a/sos/plugins/katello.py b/sos/plugins/katello.py index 54b30fac..19993884 100644 --- a/sos/plugins/katello.py +++ b/sos/plugins/katello.py @@ -14,23 +14,18 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import sos.plugintools import os +from sos.plugins import Plugin, RedHatPlugin -class katello(sos.plugintools.PluginBase): +class Katello(Plugin, RedHatPlugin): """Katello project related information """ - def defaultenabled(self): - return True - - def checkenabled(self): - self.packages = ["katello", "katello-common", "katello-headpin"] - self.files = ["/usr/bin/katello-debug"] - return sos.plugintools.PluginBase.checkenabled(self) + plugin_name = 'katello' + packages = ('katello', 'katello-common', 'katello-headpin') def setup(self): - katello_debug = "/usr/bin/katello-debug" - if os.path.isfile(katello_debug): - katello_debug_path = os.path.join(self.cInfo['dstroot'],"katello-debug") - self.collectExtOutput("%s --notar -d %s" % (katello_debug, katello_debug_path)) + katello_debug_path = os.path.join( + self.get_cmd_path(),"katello-debug") + self.add_cmd_output("%s --notar -d %s" + % ("katello-debug", katello_debug_path)) -- cgit