aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2013-03-28 17:25:05 +0000
committerBryn M. Reeves <bmr@redhat.com>2013-03-28 17:25:05 +0000
commit4f0da96964fec5bdc2b66d4117aa9773e5a12a4d (patch)
tree408a22da23a00e0a49cb34a42f89d1e7d7b8def6
parent1f90719d9d5b42d1c553ecded27a85965ce3197c (diff)
downloadsos-4f0da96964fec5bdc2b66d4117aa9773e5a12a4d.tar.gz
Rename copy_stuff() to collect()
The name copy_stuff() isn't as descriptive now that the data may be being streamed into an archive without being copied into a temporary directory. Calling it collect covers both equally well. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/__init__.py2
-rw-r--r--sos/sosreport.py6
-rw-r--r--tests/plugin_tests.py4
3 files changed, 6 insertions, 6 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index 875821c8..1ce2fb0d 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -575,7 +575,7 @@ class Plugin(object):
"""
self.customText += text
- def copy_stuff(self):
+ def collect(self):
"""Collect the data for a plugin."""
for path, sub in self.copyPaths:
self.do_copy_file_or_dir(path, sub=sub)
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 213eee72..eb4f89ee 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -636,7 +636,7 @@ class SoSReport(object):
self.archive.add_string(content="\n".join(versions), dest='version.txt')
- def copy_stuff(self):
+ def collect(self):
plugruncount = 0
for i in izip(self.loaded_plugins):
plugruncount += 1
@@ -645,7 +645,7 @@ class SoSReport(object):
sys.stdout.write("\r Running %d/%d: %s... " % (plugruncount, len(self.loaded_plugins), plugname))
sys.stdout.flush()
try:
- plug.copy_stuff()
+ plug.collect()
except KeyboardInterrupt:
raise
except:
@@ -885,7 +885,7 @@ class SoSReport(object):
self.ui_log.info(_(" Running plugins. Please wait ..."))
self.ui_log.info("")
- self.copy_stuff()
+ self.collect()
self.ui_log.info("")
diff --git a/tests/plugin_tests.py b/tests/plugin_tests.py
index 0e7869bb..153ff350 100644
--- a/tests/plugin_tests.py
+++ b/tests/plugin_tests.py
@@ -304,13 +304,13 @@ class RegexSubTests(unittest.TestCase):
def test_no_replacements(self):
self.mp.add_copy_spec(j("tail_test.txt"))
- self.mp.copy_stuff()
+ self.mp.collect()
replacements = self.mp.doFileSub(j("tail_test.txt"), r"wont_match", "foobar")
self.assertEquals(0, replacements)
def test_replacements(self):
self.mp.add_copy_spec(j("tail_test.txt"))
- self.mp.copy_stuff()
+ self.mp.collect()
replacements = self.mp.doFileSub(j("tail_test.txt"), r"(tail)", "foobar")
self.assertEquals(1, replacements)
self.assertTrue("foobar" in self.mp.archive.m.get(j('tail_test.txt')))