Bug 1495633

Summary: Option -y, --assumeyes in upgrade run do not answer yes for yum update
Product: Red Hat Satellite Reporter: Nikhil Kathole <nkathole>
Component: Satellite MaintainAssignee: Swapnil Abnave <sabnave>
Status: CLOSED CURRENTRELEASE QA Contact: Nikhil Kathole <nkathole>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: apatel, bbuckingham, inecas, kgaikwad, mmccune, sabnave, sghai, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-15 16:46:52 UTC Type: Bug
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: 1496794    
Attachments:
Description Flags
log in foreman-maintain.log file none

Description Nikhil Kathole 2017-09-26 11:19:49 UTC
Created attachment 1331003 [details]
log in foreman-maintain.log file

Description of problem: We were trying to run upgrade with  --assumeyes option.But still while performing yum update it will ask for answer.

Version-Release number of selected component (if applicable):Foreman-maintain snap 2.0


How reproducible:always


Steps to Reproduce:
1.# foreman-maintain upgrade run -h
Usage:
    foreman-maintain upgrade run [OPTIONS]

Options:
    --target-version TARGET_VERSION Target version of the upgrade
    -y, --assumeyes               Automatically answer yes for all questions
    -w, --whitelist whitelist     Comma-separated list of labels of steps to be ignored
    -f, --force                   Force steps that would be skipped as they were already run
    --phase phase                 run only a specific phase
    -h, --help                    print help

2.# foreman-maintain upgrade run --target-version 6.3 -w "repositories-setup" -y


Actual results:
Ask for answer while yum update

Transaction Summary
=========================================================================================================================================
Install    7 Packages (+85 Dependent packages)
Upgrade  172 Packages

Total download size: 105 M
Is this ok [y/d/N]:

Expected results:
It should not ask for yes if -y /--assumeyes option is passed. 

Additional info:

Comment 3 Swapnil Abnave 2017-10-04 10:46:45 UTC
This has been intentionally done to let the satellite user/admin decide whether to proceed with package update or not.

I think it should be OK to prompt [y/d/N] for this particular case.

Comment 4 Ivan Necas 2017-10-04 12:07:30 UTC
If the user chosen `-y` in the foreman-maintain, it's expected he knows what he's doing and we should not ask again. I believe the chance the user would ever chose no is very low. +1 for not asking

Comment 5 Swapnil Abnave 2017-10-05 10:51:06 UTC
Created redmine issue http://projects.theforeman.org/issues/21208 from this bug

Comment 6 Satellite Program 2017-10-18 12:23:36 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21208 has been resolved.

Comment 7 Nikhil Kathole 2017-12-18 14:26:42 UTC
Version Tested:
# rpm -q rubygem-foreman_maintain
rubygem-foreman_maintain-0.1.1-1.el7sat.noarch

Found yum update command always run with -y option independent of passing Option -y, --assumeyes in foreman-maintain upgrade run.

D, [2017-12-18 09:02:09-0500 #9172] DEBUG -- : Running command yum -y update  with stdin nil
D, [2017-12-18 09:02:38-0500 #9172] DEBUG -- : output of the command:
 Script started on Mon 18 Dec 2017 09:02:09 AM EST

If the user did not chose `-y` in the foreman-maintain, it will not ask satellite user whether to proceed with package update or not like before. I know this will not cause any problem as we were confirming that from user in prompt 

Confirm to continue with the the modification part of the upgrade, [y(yes), n(no), q(quit)]

but still to confirm is this expected change?

Comment 8 Swapnil Abnave 2018-01-02 06:10:14 UTC
@nikhil, Yes you thought it correct, this is a deliberate change that was done. Since we are already confirming whether to continue with the upgrade or not, it doesn't make sense to again ask for user confirmation before running `yum update`.

Comment 9 Nikhil Kathole 2018-01-02 06:29:06 UTC
Thanks. Moving this to VERIFIED.

Comment 10 sthirugn@redhat.com 2018-01-15 16:46:52 UTC
As per comment 7, rubygem-foreman_maintain-0.1.1-1.el7sat.noarch is the version in production now.  Closing this bug as fixed in Current release.