[yum-commits] plugins/fs-snapshot plugins/local yum-builddep.py

Tim Lauridsen timlau at osuosl.org
Wed Jan 27 06:28:12 UTC 2010


 plugins/fs-snapshot/fs-snapshot.py |    4 +---
 plugins/local/local.py             |    7 +++++--
 yum-builddep.py                    |    4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 23c63555795fa8d29877318ce8e25cb8f9d0d058
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Wed Jan 27 07:27:28 2010 +0100

    fix pylint errors.
    
    ************ Module yum-builddep
    E0602:169:YumBuildDep.get_build_deps: Undefined variable 'opts'
    ************* Module fs-snapshot
    W0107: 47:pretrans_hook: Unnecessary pass statement
    W0107: 75:pretrans_hook: Unnecessary pass statement
    W0611: 32: Unused import sys
    ************* Module local
    W0601: 39:prereposetup_hook: Global variable 'local_repo_dir' undefined at the module level
    E0602:118:_rebuild: Undefined variable 'done'

diff --git a/plugins/fs-snapshot/fs-snapshot.py b/plugins/fs-snapshot/fs-snapshot.py
index f60589f..b7ecf2f 100644
--- a/plugins/fs-snapshot/fs-snapshot.py
+++ b/plugins/fs-snapshot/fs-snapshot.py
@@ -29,7 +29,6 @@ rolled-back snapshot.  You have been warned.
 from yum.plugins import TYPE_CORE
 from yum.constants import *
 import os
-import sys
 import time
 from subprocess import Popen,PIPE
 
@@ -44,7 +43,7 @@ def pretrans_hook(conduit):
     """
     if not os.path.exists("/etc/mtab"):
         conduit.info(1, "fs-snapshot: could not open /etc/mtab")
-        pass
+        return
 
     excludeList = conduit.confString('main', 'exclude', default="").split()
 
@@ -72,7 +71,6 @@ def pretrans_hook(conduit):
         mtabfile.close()
     except Exception as (errno, strerror):
         conduit.info(1, "fs-snapshot: error reading /etc/mtab")
-    pass
 
 def _create_snapshot(device, mntpnt, type, conduit):
     """
diff --git a/plugins/local/local.py b/plugins/local/local.py
index eaa6fb3..3f16b5c 100644
--- a/plugins/local/local.py
+++ b/plugins/local/local.py
@@ -34,6 +34,7 @@ requires_api_version = '2.5'
 plugin_type = (TYPE_CORE,)
 
 def_local_repo_dir = '/var/lib/yum/plugins/local'
+local_repo_dir = ''
 
 def prereposetup_hook(conduit):
     global local_repo_dir
@@ -114,8 +115,10 @@ def _rebuild(conduit):
         args.append(cache_dir)
     args.append(local_repo_dir)
     if not quiet:
-        conduit.info(2, "== Rebuilding _local repo. with %u new packages ==" %
-                     done)
+#        FIXME: Something is rotten here, where does done come from
+#        conduit.info(2, "== Rebuilding _local repo. with %u new packages ==" %
+#                     done)
+        conduit.info(2, "== Rebuilding _local repo.  ==")
     os.spawnvp(os.P_WAIT, "createrepo", args)
     # For the prerepo. check
     os.utime("%s/repodata/repomd.xml" % local_repo_dir, None)
diff --git a/yum-builddep.py b/yum-builddep.py
index 33fc309..1e2d7ee 100755
--- a/yum-builddep.py
+++ b/yum-builddep.py
@@ -90,7 +90,7 @@ class YumBuildDep(YumUtilBase):
         # Do the real action
         # solve for each srpm and put the pkgs into a ts
         try:
-            self.get_build_deps()
+            self.get_build_deps(opts)
         except yum.Errors.MiscError, e:
             msg = "There was a problem getting the build deps, exiting:\n   %s" % e
             self.logger.error(msg)
@@ -136,7 +136,7 @@ class YumBuildDep(YumUtilBase):
     # throw them into a ts
     # run the ts
     
-    def get_build_deps(self):
+    def get_build_deps(self,opts):
         srcnames = []
         srpms = []
         for arg in self.cmds:


More information about the Yum-commits mailing list