Page 1 of 1

[OK] Unable to edit a host package via a script

Published: July 13, 2018 - 12:19 PM
by louisinger
Good morning,

I wrote a small package-script that allows me to sort my machines into groups:

Code: Select all

def install():
    print('Start dispatching')
    myWapt = Wapt(config_filename=makepath('c:', programfiles32, 'wapt', 'wapt-get.ini'))
    computer_name = environ['COMPUTERNAME']
    if not computer_name:
        error('null computer name')
        return 1
    site_name = computer_name[0:4]
    print("site name is : %s" %site_name)
    group_name = alias_groupe.get(switcher.get(site_name, 0), 'hors-lot')
    print("group name is : %s"%group_name)
    #  myWapt.register_computer()
    myWapt.edit_host(get_hostname(), append_depends = group_name)
    return 0
When I launch the package installation, I can't find the workstation to edit it. I get this:

Code: Select all

2018-07-13 12:16:28,042 INFO Unknown UUID or hostname has changed: reading host UUID
2018-07-13 12:16:28,042 INFO reading custom host UUID from WMI System Information.
2018-07-13 12:16:28,246 INFO No host package found for d054e103.mnt.fr
Does anyone know why my host package cannot be found?

Re: [OK] Unable to edit a host package via a script

Published: July 18, 2018 - 11:49 PM
by sfonteneau

Code: Select all

    myWapt = Wapt(config_filename=makepath(r'C:\Users\Administrateur\AppData\Local\waptconsole\waptconsole.ini'))
    tmpdir = 'c:/dummy'
    myWapt.edit_host('dummy.tranquilit.local',target_directory=tmpdir,append_depends='tis-firefox')
    myWapt.build_upload(r'c:\waptdev\test',private_key_passwd=ur'passwordkey',wapt_server_user='admin',wapt_server_passwd=ur'passwordserver')