From 9a007ea08bae98bca28e691181b89b16fd68ee12 Mon Sep 17 00:00:00 2001 From: Adam Stokes Date: Sun, 14 Apr 2013 12:08:42 -0400 Subject: Fix inconsistent use of tabs and spaces Signed-off-by: Adam Stokes --- sos/plugins/__init__.py | 46 +++++++++++++++++++++++----------------------- sos/plugins/hardware.py | 12 ++++++------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index b0e3ab3f..5b12bcf4 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -246,41 +246,41 @@ class Plugin(object): return False def copy_symlink(self, srcpath, sub=None): - # the target stored in the original symlink + # the target stored in the original symlink linkdest = os.readlink(srcpath) - # absolute path to the link target - absdest = os.path.normpath(os.path.join( - os.path.dirname(srcpath), linkdest)) - # adjust the target used inside the report to always be relative - if os.path.isabs(linkdest): - reldest = os.path.relpath(linkdest, - os.path.dirname(srcpath)) - self.soslog.debug("made link target %s relative as %s" - % (linkdest, reldest)) - else: - reldest = linkdest - - self.soslog.debug( - "copying link %s pointing to %s with sub=%s, isdir=%s" - % (srcpath, linkdest, sub, os.path.isdir(absdest))) + # absolute path to the link target + absdest = os.path.normpath(os.path.join( + os.path.dirname(srcpath), linkdest)) + # adjust the target used inside the report to always be relative + if os.path.isabs(linkdest): + reldest = os.path.relpath(linkdest, + os.path.dirname(srcpath)) + self.soslog.debug("made link target %s relative as %s" + % (linkdest, reldest)) + else: + reldest = linkdest + + self.soslog.debug( + "copying link %s pointing to %s with sub=%s, isdir=%s" + % (srcpath, linkdest, sub, os.path.isdir(absdest))) if os.path.isdir(absdest): self.soslog.debug("link %s is a directory, skipping..." - % linkdest) + % linkdest) return if sub: old, new = sub reldest = srcpath.replace(old, new) - # use the relative target path in the tarball + # use the relative target path in the tarball self.archive.add_link(reldest,srcpath) - # copy the symlink target translating relative targets - # to absolute paths to pass to do_copy_file_or_dir. - self.soslog.debug("normalized link target %s as %s" - %(linkdest, absdest)) - self.do_copy_file_or_dir(absdest) + # copy the symlink target translating relative targets + # to absolute paths to pass to do_copy_file_or_dir. + self.soslog.debug("normalized link target %s as %s" + %(linkdest, absdest)) + self.do_copy_file_or_dir(absdest) self.copied_files.append({ 'srcpath':srcpath, diff --git a/sos/plugins/hardware.py b/sos/plugins/hardware.py index 10601f67..f98197cd 100644 --- a/sos/plugins/hardware.py +++ b/sos/plugins/hardware.py @@ -49,11 +49,11 @@ class hardware(Plugin): self.add_cmd_output("dmidecode", root_symlink = "dmidecode") - if os.path.exists("cpufreq-info"): - self.add_cmd_output("cpufreq-info") - if os.path.exists("cpupower"): - self.add_cmd_output("cpupower info") - self.add_cmd_output("cpupower frequency-info") + if os.path.exists("cpufreq-info"): + self.add_cmd_output("cpufreq-info") + if os.path.exists("cpupower"): + self.add_cmd_output("cpupower info") + self.add_cmd_output("cpupower frequency-info") if self.policy().get_arch().endswith("386"): self.add_cmd_output("x86info -a") @@ -78,7 +78,7 @@ class RedHatHardware(hardware, RedHatPlugin): def setup(self): super(RedHatHardware, self).setup() hwpaths = glob("/usr/share/rhn/up2date*client/hardware.py") - if (len(hwpaths) == 0): + if (len(hwpaths) == 0): return self.add_cmd_output(hwpaths[0]) -- cgit