Project

General

Profile

Bug #29786

Make options for install and update commands consistent

Added by Vladimir Sedmik 10 months ago. Updated 9 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

The foreman-maintain update and foreman-maintain install commands behave differently when --assumeyes option is provided at wrong position:

1) update will correctly fail:

# bin/foreman-maintain packages update httpd --assumeyes
ERROR: too many arguments

See: 'foreman-maintain packages update --help'

2) but install will run, ignoring the --assumeyes option:

# bin/foreman-maintain packages install httpd --assumeyes
Running preparation steps required to run the next scenarios
================================================================================
Check if tooling for package locking is installed:                    [OK]
--------------------------------------------------------------------------------

Running install packages in unlocked session
================================================================================
Confirm installer run is allowed: 

WARNING: This script runs satellite-installer after the yum execution 
to ensure the Satellite is in a consistent state.
As a result some of your services may be restarted. 

Do you want to proceed?, [y(yes), q(quit)]

Both should fail (as in the first case) and should be non-interactive if the --assumeyes is provided at the right position:

# bin/foreman-maintain packages install --help
Usage:
    foreman-maintain packages install [OPTIONS] PACKAGES ...

Parameters:
    PACKAGES ...                 packages to install

Options:
    -y, --assumeyes              Automatically answer yes for all questions
    -w, --whitelist whitelist    Comma-separated list of labels of steps to be skipped
    -f, --force                  Force steps that would be skipped as they were already run
    -h, --help                   print help

History

#1 Updated by Suraj Patil 9 months ago

Please try to pass the option "--assumeyes" before the package name.

As it is described in the command usage, [OPTIONS] should come before PACKAGES.

# bin/foreman-maintain packages install --help
Usage:
    foreman-maintain packages install [OPTIONS] PACKAGES ...

#2 Updated by Vladimir Sedmik 9 months ago

Suraj Patil wrote:

Please try to pass the option "--assumeyes" before the package name.

As it is described in the command usage, [OPTIONS] should come before PACKAGES.

[...]

Yes, when the option is on the right position, it works. This issue was meant that in case 2) it should behave the same (show an error) as in case 1).

Also available in: Atom PDF