Bug 726192

Summary: -y does not work with abrt-action-install-debuginfo-to-abrt-cache
Product: [Fedora] Fedora Reporter: Chris Meek <cmeek>
Component: abrtAssignee: Michal Toman <mtoman>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: anton, cmeek, dvlasenk, fche, iprikryl, jmoskovc, kklic, mtoman, npajkovs, patrickm, pknirsch, rvokal, yann
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: abrt-2.0.3-4.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 737066 (view as bug list) Environment:
Last Closed: 2011-09-29 23:26:17 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:
Bug Depends On:    
Bug Blocks: 737066    

Description Chris Meek 2011-07-27 19:23:44 UTC
Description of problem:
When using -y to be non-interactive, abrt-action-install-debuginfo-to-abrt-cache still asks for confirmation from the user. This was also used with the --ids=- option. 

Version-Release number of selected component (if applicable):
abrt-2.0.4-1.fc16.x86_64

How reproducible:
Every time.

Steps to Reproduce:
1. run:  abrt-action-install-debuginfo-to-abrt-cache -y --ids=-
2. enter, for example: 67b1a5daf785521a097dd1f29fe9513f60f842f0
3. press ^D to close the stream
  
Actual results:
The application still asks whether to continue.

$ abrt-action-install-debuginfo-to-abrt-cache -y --ids=-
67b1a5daf785521a097dd1f29fe9513f60f842f0                                                                                       
Coredump references 1 debuginfo files, 1 of them are not installed
Looking for needed packages in repositories
Packages to download: 1
Downloading 0.20Mb, installed size: 0.87Mb. Continue? [y/N]

Expected results:
Should not ask whether to continue. Should assume 'y' for all answers, and continue to completion without interruption.

Comment 1 Chris Meek 2011-07-27 21:16:38 UTC
After briefly looking at the source code for abrt-action-install-debuginfo, it appears that the '-y' option is parsed from the command line, but nothing is done with it. Specifically, this section should check whether noninteractive is set as true or false:

if verbose != 0 or total_pkgs != 0:
	    print _("Packages to download: %u") % total_pkgs
	    question = _("Downloading %.2fMb, installed size: %.2fMb. Continue?") % (
	                 todownload_size / (1024**2),
	                 installed_size / (1024**2)
	                )
	    if not reportclient.ask_yes_no(question):
	        print _("Download cancelled by user")
	        return RETURN_OK

Comment 2 Michal Toman 2011-07-28 07:43:11 UTC
Fixed in git. If you need to use it now, you can try setting REPORT_CLIENT_RESPONSE=y env variable ("y" or whatever the response in your locale is).

Comment 3 Chris Meek 2011-08-11 18:51:24 UTC
While this does appear to fix the issue with passing -y, I am finding now that if I don't pass -y, it doesn't ask me if I want to continue. The verbose output is as follows:

$ echo 67b1a5daf785521a097dd1f29fe9513f60f842f0 | /usr/bin/abrt-action-install-debuginfo-to-abrt-cache -v  --ids=-
abrt-action-trim-files -f 4096m:/var/cache/abrt-di
Coredump references 1 debuginfo files, 1 of them are not installed
enabled repo ['rawhide-debuginfo']
enabled repo ['updates-debuginfo']
enabled repo ['fedora-debuginfo']
enabled repo ['updates-testing-debuginfo']
Looking for needed packages in repositories
Can't find packages for 0 debuginfo files
Packages to download: 1
Downloading 0.20Mb, installed size: 0.87Mb
Is this ok? [y/N] got eof, probably executed from helper, assuming - yes
Downloading (1 of 1) gzip-debuginfo-1.4-3.fc15.x86_64.rpm: 100%
Extracting /tmp/abrt-tmp-debuginfo-2011-08-10-10:18:31.9386/gzip-debuginfo-1.4-3.fc15.x86_64.rpm to /var/cache/abrt-di
Extracting cpio from /tmp/abrt-tmp-debuginfo-2011-08-10-10:18:31.9386/gzip-debuginfo-1.4-3.fc15.x86_64.rpm
cpio written OK
keeprpms = False, removing /tmp/abrt-tmp-debuginfo-2011-08-10-10:18:31.9386/gzip-debuginfo-1.4-3.fc15.x86_64.rpm
Caching files from unpacked.cpio made from gzip-debuginfo-1.4-3.fc15.x86_64.rpm
files extracted OK
Removing /tmp/abrt-tmp-debuginfo-2011-08-10-10:18:31.9386

For some reason it is getting eof when asking whether to continue, causing the download to continue.

Comment 4 Fedora Update System 2011-09-05 15:01:16 UTC
abrt-2.0.3-2.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/abrt-2.0.3-2.fc15

Comment 5 Fedora Update System 2011-09-07 00:13:24 UTC
Package abrt-2.0.3-2.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing abrt-2.0.3-2.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/abrt-2.0.3-2.fc15
then log in and leave karma (feedback).

Comment 6 Chris Meek 2011-09-08 12:55:35 UTC
Hi, I tried updating to abrt-2.0.3-2.fc15, but now when I try to run abrt-action-install-debuginfo-to-abrt-cache, it gives me this error:

$ echo 7b5ebf712404fe5a9dfe6552eae393f6b0b3b764 | /usr/bin/abrt-action-install-debuginfo-to-abrt-cache -y --ids=-

Traceback (most recent call last):
  File "/usr/bin/abrt-action-install-debuginfo", line 14, in <module>
    import reportclient
ImportError: No module named reportclient

Even if I just run this, I get the same error:

$ /usr/bin/abrt-action-install-debuginfo-to-abrt-cache

Traceback (most recent call last):
  File "/usr/bin/abrt-action-install-debuginfo", line 14, in <module>
    import reportclient
ImportError: No module named reportclient

Comment 7 Nikola Pajkovsky 2011-09-08 14:49:21 UTC
I'll provide fix asap.

Comment 8 Nikola Pajkovsky 2011-09-09 13:15:46 UTC
I'm not going to fix problem in comment#3.

Comment 9 Fedora Update System 2011-09-09 13:24:24 UTC
abrt-2.0.3-3.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/abrt-2.0.3-3.fc15

Comment 10 Frank Ch. Eigler 2011-09-09 13:24:45 UTC
Nikola, why not?  Could the code prompt on /dev/tty instead of stdin?

Comment 11 Nikola Pajkovsky 2011-09-09 13:52:59 UTC
(In reply to comment #10)
> Nikola, why not?  Could the code prompt on /dev/tty instead of stdin?

it doesn't work event with latest git tree abrt/libreport. I will clone the bug for the f15 and working on it

Comment 12 Fedora Update System 2011-09-13 16:02:07 UTC
abrt-2.0.3-4.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/abrt-2.0.3-4.fc15

Comment 13 Nikola Pajkovsky 2011-09-19 08:23:22 UTC
*** Bug 738460 has been marked as a duplicate of this bug. ***

Comment 14 Fedora Update System 2011-09-29 23:25:42 UTC
abrt-2.0.3-4.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.