From dccd33a479c0ff14d90d2939534f91964e1a393c Mon Sep 17 00:00:00 2001 From: Michael Fenn Date: Thu, 6 Nov 2014 14:05:42 -0500 Subject: SYSV: change instances of simplename to simplefile This is to better match the schema since simplefile already exists. The previous simplename attribute would fail validation. Since pkgmgr already helpfully constructs url for you if simplefile exists, the tool no longer needs to do the concatenation itself. Given the low usage rate of SYSV.py and that the original functionality was introduced in a late 1.3 release, changing the name w/o providing backwards compatiblity seems reasonable. --- doc/client/tools.txt | 4 ++-- src/lib/Bcfg2/Client/Tools/SYSV.py | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/client/tools.txt b/doc/client/tools.txt index ce8732454..26841ab11 100644 --- a/doc/client/tools.txt +++ b/doc/client/tools.txt @@ -158,14 +158,14 @@ Handles `System V Packaging - + File system format over NFS or local path: diff --git a/src/lib/Bcfg2/Client/Tools/SYSV.py b/src/lib/Bcfg2/Client/Tools/SYSV.py index a29b49efa..27c3d3785 100644 --- a/src/lib/Bcfg2/Client/Tools/SYSV.py +++ b/src/lib/Bcfg2/Client/Tools/SYSV.py @@ -52,18 +52,17 @@ class SYSV(Bcfg2.Client.Tools.PkgTool): self.origpkgtool = self.pkgtool def pkgmogrify(self, packages): - """ Take a list of pkg objects, check for a 'simplename' attribute. + """ Take a list of pkg objects, check for a 'simplefile' attribute. If present, insert a _sysv_pkg_path attribute to the package and download the datastream format SYSV package to a temporary file. """ for pkg in packages: - if pkg.get('simplename'): + if pkg.get('simplefile'): tmpfile = tempfile.NamedTemporaryFile() self.tmpfiles.append(tmpfile) - self.logger.info("Downloading %s%s to %s" % (pkg.get('url'), - pkg.get('simplename'), tmpfile.name)) - urlretrieve("%s/%s" % (pkg.get('url'), pkg.get('simplename')), - tmpfile.name) + self.logger.info("Downloading %s to %s" % (pkg.get('url'), + tmpfile.name)) + urlretrieve(pkg.get('url'), tmpfile.name) pkg.set('_sysv_pkg_path', tmpfile.name) def _get_package_command(self, packages): -- cgit v1.2.3-1-g7c22