From b40dc8df20d8b1566da45ccea0620c60de476222 Mon Sep 17 00:00:00 2001 From: Nathan Olla Date: Wed, 16 Jul 2014 15:21:39 -0400 Subject: Check for origpkgtool attribute to prevent things that subclass SYSV from breaking --- src/lib/Bcfg2/Client/Tools/SYSV.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib/Bcfg2/Client/Tools/SYSV.py b/src/lib/Bcfg2/Client/Tools/SYSV.py index 48d67c4f1..712dcce32 100644 --- a/src/lib/Bcfg2/Client/Tools/SYSV.py +++ b/src/lib/Bcfg2/Client/Tools/SYSV.py @@ -67,12 +67,14 @@ class SYSV(Bcfg2.Client.Tools.PkgTool): def _get_package_command(self, packages): """Override the default _get_package_command, replacing the attribute 'url' if '_sysv_pkg_path' if necessary in the returned command - string""" - if len(packages) == 1 and '_sysv_pkg_path' in packages[0].keys(): - self.pkgtool = (self.pkgtool[0], ('%s %s', - ['_sysv_pkg_path', 'name'])) - else: - self.pkgtool = self.origpkgtool + string + """ + if hasattr(self, 'origpkgtool'): + if len(packages) == 1 and '_sysv_pkg_path' in packages[0].keys(): + self.pkgtool = (self.pkgtool[0], ('%s %s', + ['_sysv_pkg_path', 'name'])) + else: + self.pkgtool = self.origpkgtool pkgcmd = super(SYSV, self)._get_package_command(packages) self.logger.debug("Calling install command: %s" % pkgcmd) -- cgit v1.2.3-1-g7c22