diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2013-03-28 17:03:04 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2013-03-28 17:03:04 +0000 |
commit | 1f90719d9d5b42d1c553ecded27a85965ce3197c (patch) | |
tree | db7c9e3dbd01f93a691a9db8c86703ce9461941f /example_plugins | |
parent | 2fcb1f4a6fbf5abda746bf1470edb55ccc6b01a6 (diff) | |
download | sos-1f90719d9d5b42d1c553ecded27a85965ce3197c.tar.gz |
Rename functions and methods in plugins to comply with pep8
There are lots of historical camelCase function and method names
in the plugin directory even though pep8 very clearly recommends
against these other than for external backwards compatibility.
Rename all the camelCased functions and methods and fix up the
main sosreport code, examples and tests to use the new names.
Fixes Issue #112.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Diffstat (limited to 'example_plugins')
-rwxr-xr-x | example_plugins/example.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/example_plugins/example.py b/example_plugins/example.py index 4b49e423..76977035 100755 --- a/example_plugins/example.py +++ b/example_plugins/example.py @@ -20,7 +20,7 @@ from sos.plugins import Plugin, RedHatPlugin class example(Plugin, RedHatPlugin): '''This is the description for the example plugin''' # Plugin developers want to override setup() from which they will call - # addCopySpec() to collect files and collectExtOutput() to collect programs + # add_copy_spec() to collect files and collectExtOutput() to collect programs # output. # Add your options here, indicate whether they are slow to run, and set @@ -41,16 +41,16 @@ class example(Plugin, RedHatPlugin): are provided to the output from each command. ''' # Here's how to copy files and directory trees - self.addCopySpec("/etc/hosts") + self.add_copy_spec("/etc/hosts") with open("/proc/cpuinfo") as f: for line in f: if "vendor_id" in line: - self.addAlert("Vendor ID string is: %s <br>\n" % line) + self.add_alert("Vendor ID string is: %s <br>\n" % line) # Here's how to test your options and execute if enabled - if self.isOptionEnabled("init.d"): - self.addCopySpec("/etc/init.d") # copies a whole directory tree + if self.option_enabled("init.d"): + self.add_copy_spec("/etc/init.d") # copies a whole directory tree # Here's how to execute a command self.collectExtOutput("/bin/ps -ef") |