Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Eliminate command 'remove' from subscription-manager #3444

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 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,10 +230,6 @@ _subscription_manager()
"_subscription_manager_$first" "${cur}" "${prev}"
return 0
;;
remove)
"_subscription_manager_remove" "${cur}" "${prev}"
return 0
;;
auto-attach)
"_subscription_manager_auto_attach" "${cur}" "${prev}"
return 0
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
Loading