Hide Forgot
Description of problem: Version-Release number of selected component (if applicable): server type: Red Hat Subscription Management subscription management server: 0.9.51.15-1 subscription management rules: 5.15.1 subscription-manager: 1.17.5-1.el7 python-rhsm: 1.17.2-1.el7 How reproducible: 3/3 Steps to Reproduce: 1.REgister and attach subscription 2.Add a repo-override in the system 3.Now try to remove the override without giving the override name ex: # subscription-manager repo-override --remove --repo=rhel-7-server-rhceph-1.3-tools-debug-rpms Error: You must specify a repository to modify Actual results: Observed "Error: You must specify a repository to modify" message is displayed Expected results: Message should be ex" "Error: You must specify a name of the override to remove" message is displayed Additional info:
In my opinion this is not a bug, but a misinterpreted python argument As written in the problem description comment 0, the "--repo=rhel-7-server-rhceph-1.3-tools-debug-rpms" is being interpreted as the value for the --remove option. If you re-arrange the arguments you will get the expected results... [root@jsefler-rhel7 ~]# subscription-manager repo-override --remove --repo=rhel-7-server-rhceph-1.3-tools-debug-rpms Error: You must specify a repository to modify [root@jsefler-rhel7 ~]# ^^ That is a repeat of comment 0 where "--repo=rhel-7-server-rhceph-1.3-tools-debug-rpms" is being interpreted as the value for --remove Now let's just change the order of the arguments... [root@jsefler-rhel7 ~]# subscription-manager repo-override --repo=rhel-7-server-rhceph-1.3-tools-debug-rpms --remove Usage: subscription-manager repo-override [OPTIONS] subscription-manager: error: --remove option requires an argument [root@jsefler-rhel7 ~]# VERIFIED: I would agree with the tool's response, the --remove option does indeed require an argument (the name of the override to remove).
After discussing with John , it came to our notice that the original bug is slightly different. Observed that "subscription-manager repo-override --remove= --repo=<repo id> " ==> removes all the repo-overrides from the specified repo like the --remove-all option Its the same for the --remove="" options too Steps: ======== # subscription-manager repo-override --list Repository: bar xyz: 2 Repository: foo abc: 1 efg: 1 # subscription-manager repo-override --repo=foo --remove= # subscription-manager repo-override --list Repository: bar xyz: 2 ^^ REMOVED OVERRIDES FROM --FOO REPO # subscription-manager repo-override --repo=bar --remove="" # subscription-manager repo-override --list This system does not have any content overrides applied to it. ^^ REMOVED OVERRIDES FROM --BAR REPO ,leaving no overrides on the system Expected results: Appropriate error message should be displayed when no name value is specified for --remove option ex: name: many not be null
The reason why we are suggesting that "name: may not be null" is the expected result of subscription-manager repo-override --repo=bar --remove="" is because it complements the current behavior of --add when an empty string is passed as the name of the repo parameter [root@jsefler-rhel7 ~]# subscription-manager repo-override --repo=bar --add="":VALUE name: may not be null [root@jsefler-rhel7 ~]# subscription-manager repo-override --repo=bar --add=:VALUE name: may not be null [root@jsefler-rhel7 ~]# subscription-manager repo-override --repo=bar --add :VALUE name: may not be null [root@jsefler-rhel7 ~]#
Retested on , subscription management server: 0.9.51.21-1 subscription management rules: 5.15.1 subscription-manager: 1.19.4-1.el7 python-rhsm: 1.19.2-1.el7 # subscription-manager repo-override --repo=rhel-7-server-rh-common-debug-rpms --remove= Error: You must specify an override name with --remove. # subscription-manager repo-override --repo=rhel-7-server-rh-common-debug-rpms --remove="" Error: You must specify an override name with --remove. # subscription-manager repo-override --remove= --repo=rhel-7-server-rh-common-debug-rpms Error: You must specify an override name with --remove. # subscription-manager repo-override --remove="" --repo=rhel-7-server-rh-common-debug-rpms Error: You must specify an override name with --remove. # subscription-manager repo-override --list Repository: rhel-7-server-extras-rpms enabled: 1 gpgcheck: 1 Repository: rhel-7-server-rh-common-debug-rpms enabled: 1 new: testing test: true Observed that now when no value is given for the option --remove ,an appropriate error message "Error: You must specify an override name with --remove." is displayed and none of the overrides were removed. Marking as Verified!!
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2083