You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just recently moved from centos6 to centos7 and ran into an issue with setting an asset tag on my server. I have a fix but wanted to see if this is just something specific to my setup vs an actual issue with the library.
After all of the above is installed on the server I get the following when trying to set the asset tag.
[root@localhost ~]# smbios-sys-info --asset-tag --set=M0000003
Current tag value:
Asset Tag: M
Setting new tag value: M0000003
Traceback (most recent call last):
File "/usr/sbin/smbios-sys-info", line 132, in <module>
sys.exit( main() )
File "/usr/sbin/smbios-sys-info", line 120, in main
fn(options.set, options.password_ascii, options.password_scancode)
File "/usr/lib64/python3.4/site-packages/libsmbios_c/trace_decorator.py", line 103, in trace
result = func(*args, **kw)
File "/usr/lib64/python3.4/site-packages/libsmbios_c/system_info.py", line 88, in set_asset_tag
return DLL.sysinfo_set_asset_tag(newtag, pass_ascii, pass_scancode)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
The function that this is failing in look like this.
Digging around I found that ctypes.c_char_p is expecting to be passed in bytes and not just a string which I verified was happening via a print statement. Changing the return line above to below fixes the issue and sets the asset tag properly.
Initially the rpm packages were a tad hard to install because I couldn't actually find any python3 packages for centos7 all I found was python34 and python36. This is more an issue with centos7 or just me being unable to find the proper packages but seems to be a common issue all around in centos from a few google searches. I ended up forcing the install with a rpm --nodeps since python3 is satisfied by python34 although rpm isn't smart enough to figure that out.
The text was updated successfully, but these errors were encountered:
Just recently moved from centos6 to centos7 and ran into an issue with setting an asset tag on my server. I have a fix but wanted to see if this is just something specific to my setup vs an actual issue with the library.
Version Info:
After all of the above is installed on the server I get the following when trying to set the asset tag.
The function that this is failing in look like this.
Digging around I found that
ctypes.c_char_p
is expecting to be passed in bytes and not just a string which I verified was happening via a print statement. Changing the return line above to below fixes the issue and sets the asset tag properly.Other Notes:
Initially the rpm packages were a tad hard to install because I couldn't actually find any python3 packages for centos7 all I found was python34 and python36. This is more an issue with centos7 or just me being unable to find the proper packages but seems to be a common issue all around in centos from a few google searches. I ended up forcing the install with a
rpm --nodeps
since python3 is satisfied by python34 although rpm isn't smart enough to figure that out.The text was updated successfully, but these errors were encountered: