[Spacewalk-list] No module named hardware_hal

Lichtinger, Bernhard Bernhard.Lichtinger at lrz.de
Fri Jun 2 08:25:35 UTC 2017


Hi,

> and here's my output: 
> 
> Traceback (most recent call last): 
>   File "/usr/sbin/rhnreg_ks", line 37, in <module> 
>     from up2date_client import rhnreg 
>   File "/usr/share/rhn/up2date_client/rhnreg.py", line 20, in <module> 
>     from up2date_client import hardware 
>   File "/usr/share/rhn/up2date_client/hardware.py", line 64, in <module> 
>     from up2date_client.hardware_hal import check_hal_dbus_status, get_hal_computer, read_hal 
> ImportError: No module named hardware_hal 
> 
> I've tried it with the --nohardware flag but I get the same output.  Any ideas? 

Perhaps you need to install the package "python-gobject2". 

I can vaguely remember having the same error. It is a bit tricky, because the "real error" happens in the try block at line 60 in 
"/usr/share/rhn/up2date_client/hardware.py":

try: # F13 and EL6
    from up2date_client.hardware_gudev import get_devices, get_computer_info
    using_gudev = 1
except ImportError:
    from up2date_client.hardware_hal import check_hal_dbus_status, get_hal_computer, read_hal
    using_gudev = 0

The try block fails, because "/usr/share/rhn/up2date_client/hardware_gudev.py" has:

if dist()[0] == 'SuSE':
    # import gi.repository.GUdev fail and
    # make the import gudev after it fail too
    # so we have to import gudev only
    import gudev
    import glib
    gi_gudev = False

And this fails because "import glib" fails. 
The package "python-gobject2" will install "/usr/lib64/python2.7/site-packages/glib"

And if the python module glib is missing, the except block is tried and this block fails also, which gives you your error message.

I have to admit that I was too lazy to file a bug report that "python-gobject2" should be a dependency for "rhn-client-tools" on SLES.


Regards,
Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5128 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20170602/b07469fe/attachment.p7s>


More information about the Spacewalk-list mailing list