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

Allow to call RegisterWithActivationKeys() with enable_content #3488

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jirihnidek
Copy link
Contributor

  • Allow to call D-Bus method RegisterWithActivationKeys() with
    register option enable_content. When this option is not set,
    then behavior is still the same. It means that content is
    enabled by default, when system is registered with this D-Bus
    method.
  • Added two unit tests
  • Some refactoring and bug fixes in separate commits

* When D-Bus method Register() was called with enable_content
  option and the value was "false" or "0", then code evaluated
  this value as True.
* Fixed this issue, because previous behavior was very confusing
* Refactored code a little bit.
  * The method is static method
  * It is possible to set default value, when enable_content
    was not set at all.
* Converted method to static method
* Deleted dead code
* Deleted empty lines
Copy link

github-actions bot commented Jan 6, 2025

Coverage

Coverage (computed on Fedora latest) •
FileStmtsMissCoverMissing
rhsmlib/dbus/objects
   register.py2307268%36, 97–98, 111–112, 122–123, 125–126, 136–137, 139, 153, 156, 169, 172, 230, 239, 279–280, 287, 310, 317, 360–362, 364–365, 385–389, 391–393, 395, 397, 399, 418–421, 423–425, 427, 429, 431, 446, 450, 467–472, 474–476, 478, 480, 492–496, 498–500, 502, 504
TOTAL17435445774% 

Tests Skipped Failures Errors Time
2418 14 💤 0 ❌ 0 🔥 31.271s ⏱️

* Allow to call D-Bus method RegisterWithActivationKeys() with
  register option enable_content. When this option is not set,
  then behavior is still the same. It means that content is
  enabled by default, when system is registered with this D-Bus
  method.
* Added two unit tests
@jirihnidek jirihnidek force-pushed the jhnidek/register_activation_keys_and_enable_content_opt branch from 54329a3 to cb97911 Compare January 6, 2025 16:41
@Archana-PandeyM
Copy link

In case the implementation is done- I tried using this subman build on rhel 10 with rhc copr builds that support this feature. I hit the same error as before when using activation key. Sharing the logs from rhsm.log-
e found for domain: 'rhsm' 2025-01-09T08:12:27.625+01:00 [ERROR] rhsm-service:32088:MainThread @util.py:72 - Unknown arguments: dict_keys(['enable_content']) Traceback (most recent call last): File "/usr/lib64/python3.12/site-packages/rhsmlib/dbus/util.py", line 70, in dbus_handle_exceptions return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.12/site-packages/rhsmlib/dbus/objects/register.py", line 499, in RegisterWithActivationKeys dbus_sender.set_cmd_line(sender=self.sender, cmd_line=self.cmd_line) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.12/site-packages/rhsmlib/dbus/objects/register.py", line 265, in register_with_activation_keys enable_content: bool = self._remove_enable_content_option(register_options, default=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.12/site-packages/rhsmlib/services/register.py", line 67, in register # signature we want to consider that an error. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rhsmlib.services.exceptions.ValidationError: Unknown arguments: dict_keys(['enable_content'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants