[yum-commits] plugins/security

James Antill james at osuosl.org
Thu Aug 19 12:52:32 UTC 2010


 plugins/security/security.py |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 39659ad785aa398b42027b462a54c60a4e3e49d7
Author: James Antill <james at and.org>
Date:   Thu Aug 19 08:52:10 2010 -0400

    Use .text() for notices, to drop files output by default.

diff --git a/plugins/security/security.py b/plugins/security/security.py
index ece37bb..ed589f3 100755
--- a/plugins/security/security.py
+++ b/plugins/security/security.py
@@ -181,6 +181,10 @@ class UpdateinfoCommand:
                    'info-sec'           : 'info',
                    'summary-updateinfo' : 'summary'}
 
+    #  Note that this code (instead of using inheritance and multiple
+    # cmd classes) means that "yum help" only displays the updateinfo command.
+    # Which is what we want, because the other commands are just backwards
+    # compatible gunk we don't want the user using).
     def getNames(self):
         return ['updateinfo'] + sorted(self.direct_cmds.keys())
 
@@ -233,8 +237,18 @@ class UpdateinfoCommand:
             if notice['update_id'] in show_pkg_info_done:
                 continue
             show_pkg_info_done[notice['update_id']] = notice
-            # Python-2.4.* doesn't understand str(x) returning unicode *sigh*
-            obj = notice.__str__()
+
+            if hasattr(notice, 'text'):
+                debug_log_lvl = yum.logginglevels.DEBUG_3
+                vlog = logging.getLogger("yum.verbose.main")
+                if vlog.isEnabledFor(debug_log_lvl):
+                    obj = notice.text(skip_data=[])
+                else:
+                    obj = notice.text()
+            else:
+                # Python-2.4.* doesn't understand str(x) returning unicode
+                obj = notice.__str__()
+
             if list_type == 'all':
                 if _rpm_tup_vercmp(iname2tup[pkgtup[0]], pkgtup) >= 0:
                     obj = obj + "\n  Installed : true"


More information about the Yum-commits mailing list