Bug 462159

Summary: "Total" summary always displayed in yum-cron jobs.
Product: [Fedora] Fedora Reporter: Jan ONDREJ <ondrejj>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: ffesti, james.antill, katzj, om, pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-11-01 09:46:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan ONDREJ 2008-09-13 05:47:56 UTC
Description of problem:
After update to 3.2.19, I get daily unwanted messages from yum cron jobs (I am using yum-cron package). I think yum-cron was nothing with this and this is a bug of yum. They contains some "----" and a "Total" summary lines, which are features of new yum. They looks well for standard output, but are disturbing, if nothing else is displayed.


Version-Release number of selected component (if applicable):
yum-3.2.19-3.fc9.noarch


How reproducible:
I think always from cron, but I can't reproduce from command line.

Steps to Reproduce (tryed this, but it's a wrong code to reproduce):
1. rpm -e arj
2. rm -rf /var/cache/yum/*
3. yum -e 0 -d 0 -y install arj
  
Actual results (from cron email):
/etc/cron.daily/yum.cron:

--------------------------------------------------------------------------------
Total                                           3.7 MB/s |  20 MB     00:05


Expected results:
Nothing or other errors/warnings produced by rpm/yum.

Additional info:
Even if I can't reproduce, I think this code from output.py is responsible for this behaviour (starting line 878):

        print "-" * tl.rest()
        dl_time = time.time() - download_start_timestamp
        ui_size = tl.add(' | %5sB' % self.format_number(remote_size))
        ui_time = tl.add(' %9s' % self.format_time(dl_time))
        ui_end  = tl.add(' ' * 5)
        ui_bs   = tl.add(' %5sB/s' % self.format_number(remote_size / dl_time))
        print "%-*.*s%s%s%s%s" % (tl.rest(), tl.rest(), _("Total"),
                                  ui_bs, ui_size, ui_time, ui_end)

There print statements have to be a "self.verbose_logger.log()" functions with proper parameters to display this message only if we are reached defined log/debug level.

Please, can you fix this to avoid my daily problems? Thank you.

Comment 1 Otto J. Makela 2008-09-15 10:21:57 UTC
I can confirm this, I get the same message from cron runs, but am also unable to reproduce it from the command line:

--------------------------------------------------------------------------------
Total                                           323 kB/s | 1.9 MB     00:05

Comment 2 Jan ONDREJ 2008-09-15 10:50:10 UTC
New steps to reproduce (works for me. Otto, can you confirm?):

1. # download some old packages
   yumdownloader alsa-lib-1.0.16-3.fc9.i386 alsa-lib-devel-1.0.16-3.fc9.i386.rpm
2. # install them
   rpm -Uhv --oldpackage alsa-lib-devel-1.0.16-3.fc9.i386.rpm alsa-lib-1.0.16-3.fc9.i386.rpm
3. # run update
   yum -e 0 -d 0 -y update

Actual results:
update--------------------------------------------------------------------------------
Total                                           8.3 MB/s | 1.4 MB     00:00     

Expected results:
  NOTHING

You need yum-utils to test these steps.

I can also make an patch, but I think Seth can make better patch. :-)

Comment 3 Otto J. Makela 2008-09-15 14:08:53 UTC
After a bit of testing, it seems what is required to produce the typical "Total" output is more than one package getting updated or installed:

nimrod:/tmp# ls -l alsa-lib-*
-rw-r--r-- 1 root root 416593 2008-04-15 06:03 alsa-lib-1.0.16-3.fc9.i386.rpm
-rw-r--r-- 1 root root 985991 2008-04-15 06:04 alsa-lib-devel-1.0.16-3.fc9.i386.rpm
nimrod:/tmp# rpm -vUh --oldpackage alsa-lib-*
Preparing...                ########################################### [100%]
   1:alsa-lib               ########################################### [ 50%]
   2:alsa-lib-devel         ########################################### [100%]
nimrod:/tmp# yum -e 0 -d 0 -y update
--------------------------------------------------------------------------------
Total                                           1.8 MB/s | 1.4 MB     00:00
nimrod:/tmp# rpm -qa 'alsa-lib*'
alsa-lib-devel-1.0.17-2.fc9.i386
alsa-lib-1.0.17-2.fc9.i386

So yes, I can duplicate this.

Comment 4 Tim Lauridsen 2008-11-01 09:46:04 UTC
Looks like it is fixed upstream, reopen if yum -e 0 -d 0 -y update
is not silent