ATIX-AG / foreman_scc_manager

Foreman plugin to sync SUSE Customer Center products and repositories into Katello
GNU General Public License v3.0
15 stars 11 forks source link

I am unable to register SLES 12SP5 servers in foreman #135

Closed netamego closed 6 months ago

netamego commented 6 months ago

Hi,

First of all, I wanted to thank you for the plugin you have developed and shared with the community. It's fantastic.

As I was saying, the plugin foreman_scc_manager (2.3.0) works perfectly, and I haven't encountered any issues in installing and configuring it in my foreman-katello installation (foreman Version 3.9.1 / Katello 4.11.0).

The problem arises when registering SLES12SP5 clients. I have followed instructions on the page https://apt.atix.de/html/sles.html, but I encounter several issues:

1.- I have added the repository https://oss.atix.de/SLES12SP5, but when trying to install the package subscription-manager, it fails due to a dependency on the package python-iniparse. This package exists in the SUSE_Package_Hub_15_SP5 repository but does not exist in the SUSE_Package_Hub_12_SP5 repository.

2.- I have installed the Python module with "pip install iniparse" and forced the installation of the subscription-manager package by skipping the dependency.

3.- I have downloaded the script katello-rhsm-consumer from my Foreman server (https://foreman.example.com/pub/katello-rhsm-consumer) and executed it. However, it fails with the following message:

Unable to find Subscription Manager module.
Error: No module named rhsm.config

subscription-manager package also installs other files like /usr/lib/rhsmd, which fails with exactly the same error:

#/usr/lib/rhsmd
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/subscription_manager/scripts/rhsm_d.py", line 43, in excepthook_base
    sys.exit(0)
AttributeError: 'NoneType' object has no attribute 'exit'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/rhsmd", line 9, in <module>
    load_entry_point('subscription-manager==1.27.0', 'console_scripts', 'rhsmd')()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 487, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2728, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2346, in load
    return self.resolve()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2352, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib64/python2.7/site-packages/subscription_manager/scripts/rhsm_d.py", line 62, in <module>
    from subscription_manager import logutil
  File "/usr/lib64/python2.7/site-packages/subscription_manager/logutil.py", line 19, in <module>
    import rhsm.config
**ImportError: No module named rhsm.config**

I'm not sure if I'm doing something wrong. Is it possible that the subscription-manager package for SLES12SP5 requires some additional Python modules that are not included in the package itself?

Thanks a lot.

netamego commented 6 months ago

Seems to work installing packages from https://build.opensuse.org/project/show/home:orcharhino:sles_12

netamego commented 6 months ago

Seems to work installing packages from https://build.opensuse.org/project/show/home:orcharhino:sles_12

netamego commented 6 months ago

Seems to work installing packages from https://build.opensuse.org/project/show/home:orcharhino:sles_12