From 2defc9cf5155f21a988855c31049fad3e40ecdd1 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 29 Jan 2014 07:43:06 -0500 Subject: load correct JSON library on py2.4 --- src/lib/Bcfg2/Server/Plugins/Packages/Yum.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Yum.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py index 66f8e9dbe..43a54471c 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py @@ -87,7 +87,8 @@ try: import yum try: import json - except ImportError: + json.loads # py2.4 json library is structured differently + except (ImportError, AttributeError): import simplejson as json HAS_YUM = True except ImportError: -- cgit v1.2.3-1-g7c22 From 8ac001a3dffebf8e7d3fa7db20f13e58b90dd5b4 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Thu, 30 Jan 2014 07:30:18 -0500 Subject: fixed pylint tests --- src/lib/Bcfg2/Server/Plugins/Packages/Yum.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Yum.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py index 43a54471c..f038ec9c0 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py @@ -87,7 +87,8 @@ try: import yum try: import json - json.loads # py2.4 json library is structured differently + # py2.4 json library is structured differently + json.loads # pylint: disable=W0104 except (ImportError, AttributeError): import simplejson as json HAS_YUM = True -- cgit v1.2.3-1-g7c22 From 58cee8566fba7b48d127227d96c98549b7db3028 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Mon, 10 Feb 2014 09:24:56 -0500 Subject: testsuite: Fixed several pylint 1.0 issues --- src/lib/Bcfg2/Server/Plugins/Packages/Yum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Yum.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py index f038ec9c0..7b5475ecc 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py @@ -323,7 +323,7 @@ class YumCollection(Collection): self.fam) @property - def disableMetaData(self): + def disableMetaData(self): # pylint: disable=C0103 """ Report whether or not metadata processing is enabled. This duplicates code in Packages/__init__.py, and can probably be removed in Bcfg2 1.4 when we have a module-level setup -- cgit v1.2.3-1-g7c22 From c9e234dc15b527c930bbb5a1e7e0e7d9212168b1 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 21 Feb 2014 08:39:18 -0500 Subject: Yum: only fork to find bcfg2-yum-helper once, for real --- src/lib/Bcfg2/Server/Plugins/Packages/Yum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Yum.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py index 7b5475ecc..71c6d003c 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py @@ -354,7 +354,7 @@ class YumCollection(Collection): a call to it; I wish there was a way to do this without forking, but apparently not); finally we check in /usr/sbin, the default location. """ - if not self._helper: + if not self.__class___helper: # pylint: disable=W0212 try: self.__class__._helper = self.setup.cfp.get("packages:yum", @@ -368,7 +368,7 @@ class YumCollection(Collection): except OSError: self.__class__._helper = "/usr/sbin/bcfg2-yum-helper" # pylint: enable=W0212 - return self._helper + return self.__class__._helper @property def use_yum(self): -- cgit v1.2.3-1-g7c22 From 673c947a552ab601b159e7a95e3506870d837328 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 21 Feb 2014 08:53:09 -0500 Subject: Yum: fix pylint tests --- src/lib/Bcfg2/Server/Plugins/Packages/Yum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Yum.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py index 71c6d003c..a149ccfe2 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py @@ -354,8 +354,8 @@ class YumCollection(Collection): a call to it; I wish there was a way to do this without forking, but apparently not); finally we check in /usr/sbin, the default location. """ + # pylint: disable=W0212 if not self.__class___helper: - # pylint: disable=W0212 try: self.__class__._helper = self.setup.cfp.get("packages:yum", "helper") @@ -367,8 +367,8 @@ class YumCollection(Collection): self.__class__._helper = 'bcfg2-yum-helper' except OSError: self.__class__._helper = "/usr/sbin/bcfg2-yum-helper" - # pylint: enable=W0212 return self.__class__._helper + # pylint: enable=W0212 @property def use_yum(self): -- cgit v1.2.3-1-g7c22 From 9d12865d7598544bbbe2bb4b40c085c101b3d42e Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 21 Feb 2014 09:09:51 -0500 Subject: Fixed typo Note to self: do not push code before 9 am --- src/lib/Bcfg2/Server/Plugins/Packages/Yum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Yum.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py index a149ccfe2..67ff05ca1 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py @@ -355,7 +355,7 @@ class YumCollection(Collection): forking, but apparently not); finally we check in /usr/sbin, the default location. """ # pylint: disable=W0212 - if not self.__class___helper: + if not self.__class__._helper: try: self.__class__._helper = self.setup.cfp.get("packages:yum", "helper") -- cgit v1.2.3-1-g7c22