Page 1 of 1

[SOLVED] no attribute 'set_computer_description'

Published: March 24, 2023 - 12:45
by Information Service
Hello everyone,

client version: 2.2.3
OS: Debian 11.

I want to add a description when the client is retrieved. To do this, I'm using the following command:

`wapt-get register "description"`

and I get the following error message:

`CRITICAL Unable to change computer description to Test_description: module 'setuphelpers' has no attribute 'set_computer_description'`.

Looking forward to your feedback.

Sincerely.

Re: no attribute 'set_computer_description'

Published: March 24, 2023 - 1:36 PM
by sfonteneau
Good morning

Yes, that's a problem under Linux.

On Windows, you set the post description in the section designated for this purpose:

Code: Select all

def set_computer_description(description):
    """Change the computer descrption"""
    global _fake_hostname
    if _fake_hostname is not None:
        logger.warning('Skippig set_computer_description for fake host')
    elif wmi:
        for win32_os in wmi.WMI().Win32_OperatingSystem():
            win32_os.Description = description
    else:
        raise Exception('WMI not available')
However, under Linux or Mac there is no concept of description, so for the moment we haven't done anything and the function doesn't exist


We should invent one for wapt.

either create a file in

Code: Select all

/opt/wapt/description
Or we can put it in the system's etc

Code: Select all

/etc/description 

Re: no attribute 'set_computer_description'

Published: March 24, 2023 - 2:10 PM
by Information Service
OK,

thanks for the feedback.

Have a good day.