summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Packages/YumHelper.py
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/YumHelper.py
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/YumHelper.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/YumHelper.py17
1 files changed, 16 insertions, 1 deletions
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)