Skip to content

Commit

Permalink
feat: Eliminate command 'remove' from subscription-manager
Browse files Browse the repository at this point in the history
This PR eliminates the subscription-manager remove sub-command.

fixes: https://issues.redhat.com/browse/CCT-426
  • Loading branch information
jvlcek committed Sep 3, 2024
1 parent 00deef2 commit f8ce2a9
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 393 deletions.
24 changes: 1 addition & 23 deletions etc-conf/subscription-manager.completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,6 @@ _subscription_manager_unregister()
COMPREPLY=($(compgen -W "${opts}" -- ${1}))
}

_subscription_manager_remove()
{
# try to autocomplete serial number as well
case $prev in
--serial)
SERIALS=$(LANG=C /usr/sbin/subscription-manager list --consumed 2>/dev/null | sed -ne "s|Serial:\s*\(\S*\)|\1|p" )
COMPREPLY=($(compgen -W "${SERIALS}" -- ${1}))
return 0
;;
--pool)
POOLS=$(LANG=C /usr/sbin/subscription-manager list --consumed 2>/dev/null | sed -ne "s|Pool ID:\s*(\S*\)|\1|p" )
COMPREPLY=($(compgen -W "${POOLS}" -- ${1}))
return 0
;;
esac
local opts="--serial --pool --all
${_subscription_manager_common_opts}"
COMPREPLY=($(compgen -W "${opts}" -- ${1}))
}

_subscription_manager_clean()
{
local opts="-h --help"
Expand Down Expand Up @@ -227,7 +207,7 @@ _subscription_manager()

# top-level commands and options
opts="auto-attach clean config environments facts identity list orgs
repo-override plugins refresh register release remove repos status
repo-override plugins refresh register release repos status
syspurpose unregister version ${_subscription_manager_help_opts}"

case "${first}" in
Expand All @@ -250,8 +230,6 @@ _subscription_manager()
"_subscription_manager_$first" "${cur}" "${prev}"
return 0
;;
remove)
"_subscription_manager_remove" "${cur}" "${prev}"
return 0
;;
auto-attach)
Expand Down
32 changes: 0 additions & 32 deletions man/subscription-manager.8
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ must be passed as system arguments in a non-interactive session.
.IP
4. auto-attach

.IP
5. remove

.IP
6. release

Expand Down Expand Up @@ -299,33 +296,6 @@ Disables the auto-attach option for the system. If auto-attach is disabled, then
.B --show
Shows whether auto-attach is enabled on the systems.

.SS REMOVE OPTIONS
The
.B remove
command removes a subscription from the system. (This does not uninstall the associated products.)

.TP
.B --serial=SERIALNUMBER
Gives the serial number of the subscription certificate for the specific product to remove from the system. Subscription certificates attached to a system are in a certificate, in
.B /etc/pki/entitlement/<serial_number>.pem.
To remove multiple subscriptions, use the
.B --serial
option multiple times.

.TP
.B --pool=POOLID
Removes all subscription certificates for the specified pool id from the system.
To remove multiple sets of subscriptions, use the
.B --pool
option multiple times.

.TP
.B --all
Removes
.I all
of the subscriptions attached to a system.


.SS RELEASE OPTIONS
The
.B release
Expand Down Expand Up @@ -903,8 +873,6 @@ Overall Status: Insufficient
As the structures of subscription configuration have changed, some of the original management commands have become obsolete. These commands have been replaced with updated commands.

.TP
.B unsubscribe
This has been replaced with \fBremove\fP.

.SH USAGE
.B subscription-manager
Expand Down
212 changes: 0 additions & 212 deletions src/subscription_manager/cli_command/remove.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/subscription_manager/managercli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from subscription_manager.cli_command.refresh import RefreshCommand
from subscription_manager.cli_command.register import RegisterCommand
from subscription_manager.cli_command.release import ReleaseCommand
from subscription_manager.cli_command.remove import RemoveCommand
from subscription_manager.cli_command.repos import ReposCommand
from subscription_manager.cli_command.status import StatusCommand
from subscription_manager.cli_command.syspurpose import SyspurposeCommand
Expand Down Expand Up @@ -64,7 +63,6 @@ def __init__(self):
StatusCommand,
EnvironmentsCommand,
VersionCommand,
RemoveCommand,
PluginsCommand,
AutohealCommand,
OverrideCommand,
Expand Down
37 changes: 0 additions & 37 deletions test/cli_command/test_remove.py

This file was deleted.

Loading

0 comments on commit f8ce2a9

Please sign in to comment.