Skip to content

Commit

Permalink
feat: Removed D-Bus methods related to attach
Browse files Browse the repository at this point in the history
* Card ID: CCT-425
* Removed interface: com.redhat.RHSM1.Attach
* Removed AutoAttach and PoolAttach
* Modified Register method
* Removed unit tests related to removed methods
* Modified unit tests of register D-Bus methods
  • Loading branch information
jirihnidek committed Jun 3, 2024
1 parent 6037cf8 commit 71340d5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 536 deletions.
1 change: 0 additions & 1 deletion src/rhsmlib/dbus/objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from rhsmlib.dbus.objects.config import ConfigDBusObject # NOQA
from rhsmlib.dbus.objects.main import Main # NOQA
from rhsmlib.dbus.objects.register import RegisterDBusObject, DomainSocketRegisterDBusObject # NOQA
from rhsmlib.dbus.objects.attach import AttachDBusObject # NOQA
from rhsmlib.dbus.objects.products import ProductsDBusObject # NOQA
from rhsmlib.dbus.objects.unregister import UnregisterDBusObject # NOQA
from rhsmlib.dbus.objects.entitlement import EntitlementDBusObject # NOQA
Expand Down
141 changes: 0 additions & 141 deletions src/rhsmlib/dbus/objects/attach.py

This file was deleted.

19 changes: 3 additions & 16 deletions src/rhsmlib/dbus/objects/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from rhsmlib.dbus import constants, exceptions, dbus_utils, base_object, server, util
from rhsmlib.services.register import RegisterService
from rhsmlib.services.unregister import UnregisterService
from rhsmlib.services.attach import AttachService
from rhsmlib.services.entitlement import EntitlementService
from rhsmlib.client_info import DBusSender
from subscription_manager.cp_provider import CPProvider
Expand Down Expand Up @@ -268,22 +267,12 @@ def _remove_enable_content_option(self, options: dict) -> bool:
return bool(options.pop("enable_content"))

def _enable_content(self, uep: "UEPConnection", consumer: dict) -> None:
"""Try to enable content: Auto-attach in non-SCA or refresh in SCA mode."""
"""Try to enable content: refresh SCA entitlement certs in SCA mode."""
content_access: str = consumer["owner"]["contentAccessMode"]
enabled_content = None

if content_access == "entitlement":
log.debug("Auto-attaching since 'enable_content' is true.")
service = AttachService(uep)
enabled_content = service.attach_auto()
if len(enabled_content) > 0:
log.debug("Updating entitlement certificates")
# FIXME: The enabled_content contains all data necessary for generating entitlement
# certificate and private key. Thus we could save few REST API calls, when the data was used.
EntCertActionInvoker().update()
else:
log.debug("No content was enabled, entitlement certificates not updated.")

log.error("Entitlement content access mode is not supported")
elif content_access == "org_environment":
log.debug("Refreshing since 'enable_content' is true.")
service = EntitlementService(uep)
Expand Down Expand Up @@ -409,8 +398,6 @@ def Register(self, org, username, password, options, connection_options, locale)
used.
Options is a dict of strings that modify the outcome of this method.
Note this method is registration ONLY. Auto-attach is a separate process.
"""
org = dbus_utils.dbus_to_python(org, expected_type=str)
connection_options = dbus_utils.dbus_to_python(connection_options, expected_type=dict)
Expand All @@ -435,7 +422,7 @@ def Register(self, org, username, password, options, connection_options, locale)
@util.dbus_handle_exceptions
def RegisterWithActivationKeys(self, org, activation_keys, options, connection_options, locale):
"""
Note this method is registration ONLY. Auto-attach is a separate process.
This method registers the system using organization and activation keys
"""
connection_options = dbus_utils.dbus_to_python(connection_options, expected_type=dict)
options = dbus_utils.dbus_to_python(options, expected_type=dict)
Expand Down
1 change: 0 additions & 1 deletion src/subscription_manager/scripts/rhsm_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def main():
object_classes = [
objects.ConfigDBusObject,
objects.RegisterDBusObject,
objects.AttachDBusObject,
objects.ProductsDBusObject,
objects.UnregisterDBusObject,
objects.EntitlementDBusObject,
Expand Down
159 changes: 0 additions & 159 deletions test/rhsmlib/dbus/test_attach.py

This file was deleted.

Loading

0 comments on commit 71340d5

Please sign in to comment.