Bug 1495633 - Option -y, --assumeyes in upgrade run do not answer yes for yum update
Summary: Option -y, --assumeyes in upgrade run do not answer yes for yum update
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Swapnil Abnave
QA Contact: Nikhil Kathole
URL:
Whiteboard:
Depends On:
Blocks: 1496794
TreeView+ depends on / blocked
 
Reported: 2017-09-26 11:19 UTC by Nikhil Kathole
Modified: 2019-09-26 15:38 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-15 16:46:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log in foreman-maintain.log file (105.35 KB, text/plain)
2017-09-26 11:19 UTC, Nikhil Kathole
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 21208 0 None None None 2017-10-05 10:51:10 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.