summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Packages
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-08-09 16:45:45 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-08-09 16:45:45 -0400
commit0f7edd60e67d32438a8be42002faacde4e4a7649 (patch)
tree2b11b02f5bf4f9e7a6e609136bf2a19c8f166cc4 /src/lib/Bcfg2/Server/Plugins/Packages
parentcc11ada6b8871d7719fd0ea8a2ff382bba8a3bc2 (diff)
downloadbcfg2-0f7edd60e67d32438a8be42002faacde4e4a7649.tar.gz
bcfg2-0f7edd60e67d32438a8be42002faacde4e4a7649.tar.bz2
bcfg2-0f7edd60e67d32438a8be42002faacde4e4a7649.zip
testsuite: fixed most pylint complaints
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/Collection.py1
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/Source.py1
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/YumHelper.py17
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/__init__.py3
4 files changed, 18 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Collection.py b/src/lib/Bcfg2/Server/Plugins/Packages/Collection.py
index 0df8624f6..8b20df58a 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Collection.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/Collection.py
@@ -595,7 +595,6 @@ def get_collection_class(source_type):
:type source_type: string
:returns: type - the Collection subclass that should be used to
instantiate an object to contain sources of the given type. """
- cls = None
for mod in Bcfg2.Options.setup.packages_backends:
if mod.__name__.endswith(".%s" % source_type.title()):
return getattr(mod, "%sCollection" % source_type.title())
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
index e1659dbb3..4b6130f72 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
@@ -49,7 +49,6 @@ in your ``Source`` subclass. For an example of this kind of
import os
import re
import sys
-import Bcfg2.Server.Plugin
from Bcfg2.Logger import Debuggable
from Bcfg2.Compat import HTTPError, HTTPBasicAuthHandler, \
HTTPPasswordMgrWithDefaultRealm, install_opener, build_opener, urlopen, \
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/YumHelper.py b/src/lib/Bcfg2/Server/Plugins/Packages/YumHelper.py
index 32db0b32d..dcb8718a0 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/YumHelper.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/YumHelper.py
@@ -266,6 +266,8 @@ class CacheManager(YumHelper):
class HelperSubcommand(Bcfg2.Options.Subcommand):
+ """ Base class for all yum helper subcommands """
+
# the value to JSON encode and print out if the command fails
fallback = None
@@ -300,10 +302,14 @@ class HelperSubcommand(Bcfg2.Options.Subcommand):
return 0
def _run(self, setup, data):
+ """ Actually run the command """
raise NotImplementedError
class DepSolverSubcommand(HelperSubcommand):
+ """ Base class for helper commands that use the depsolver (i.e.,
+ only resolve dependencies, don't modify the cache) """
+
def __init__(self):
HelperSubcommand.__init__(self)
self.depsolver = DepSolver(Bcfg2.Options.setup.yum_config,
@@ -311,6 +317,8 @@ class DepSolverSubcommand(HelperSubcommand):
class CacheManagerSubcommand(HelperSubcommand):
+ """ Base class for helper commands that use the cachemanager
+ (i.e., modify the cache) """
fallback = False
accept_input = False
@@ -321,18 +329,22 @@ class CacheManagerSubcommand(HelperSubcommand):
class Clean(CacheManagerSubcommand):
+ """ Clean the cache """
def _run(self, setup, data): # pylint: disable=W0613
self.cachemgr.clean_cache()
return True
class MakeCache(CacheManagerSubcommand):
+ """ Update the on-disk cache """
def _run(self, setup, data): # pylint: disable=W0613
self.cachemgr.populate_cache()
return True
class Complete(DepSolverSubcommand):
+ """ Given an initial set of packages, get a complete set of
+ packages with all dependencies resolved """
fallback = dict(packages=[], unknown=[])
def _run(self, _, data):
@@ -344,6 +356,7 @@ class Complete(DepSolverSubcommand):
class GetGroups(DepSolverSubcommand):
+ """ Resolve the given package groups """
def _run(self, _, data):
rv = dict()
for gdata in data:
@@ -356,10 +369,11 @@ class GetGroups(DepSolverSubcommand):
return rv
-Get_Groups = GetGroups
+Get_Groups = GetGroups # pylint: disable=C0103
class CLI(Bcfg2.Options.CommandRegistry):
+ """ The bcfg2-yum-helper CLI """
options = [
Bcfg2.Options.PathOption(
"-c", "--yum-config", help="Yum config file"),
@@ -377,6 +391,7 @@ class CLI(Bcfg2.Options.CommandRegistry):
self.logger = logging.getLogger(parser.prog)
def run(self):
+ """ Run bcfg2-yum-helper """
if not os.path.exists(Bcfg2.Options.setup.yum_config):
self.logger.error("Config file %s not found" %
Bcfg2.Options.setup.yum_config)
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
index e6240f39a..efd0bbe4a 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
@@ -124,7 +124,8 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
Bcfg2.Options.PathOption(
cf=("packages", "apt_config"),
help="The default path for generated apt configs",
- default="/etc/apt/sources.list.d/bcfg2-packages-generated-sources.list")]
+ default=
+ "/etc/apt/sources.list.d/bcfg2-packages-generated-sources.list")]
#: Packages is an alternative to
#: :mod:`Bcfg2.Server.Plugins.Pkgmgr` and conflicts with it.