Good morning,
By following the example, I was able to install the package on the machine I use to create packages
Here is my code:
Code: Select all
# -*- coding: utf-8 -*-
from setuphelpers import *
from pyad import *
uninstallkey = []
def install():
print('installation fusioninventory-agent')
#Initialisations diverses
ServerFusion = "http://adresse serveur fusion"
idLycee=138
#Recup nom ordinateur et chemin LDAP
ComputerName = get_computername()
ComputerLDAP = pyad.adsearch.by_cn(ComputerName)
#Transformation pour extraction de l'OU
ComputerTab = ComputerLDAP.split(",")
ComputerExtract = ComputerTab[1].split("=")
ComputerOU = ComputerExtract[1]
tag = "%s;%s" % (idLycee,ComputerOU)
print tag
#Lancement de la commande install silencieuse
if iswin64() :
run(r'"fusioninventory-agent_windows-x64_2.3.21.exe" /acceptlicense /runnow /tag="%s" /server="%s" /S' % (tag, ServerFusion))
else:
run(r'"fusioninventory-agent_windows-x64_2.3.21.exe" /acceptlicense /runnow /tag="%s" /server="%s" /S' % (tag, ServerFusion))
However, if I deploy it on a client machine, I get the error
ImportError: No module named builtins
Client workstation log:
Code: Select all
2018-02-07 11:16:45,677 CRITICAL Error importing c:\windows\temp\waptbsr9b4\setup.py :
Traceback (most recent call last):
File "c:\wapt\common.py", line 795, in import_setup
py_mod = imp.load_source(modulename, setupfilename)
File "c:\windows\temp\waptbsr9b4\setup.py", line 3, in <module>
from pyad import *
File "c:\windows\temp\waptbsr9b4\pyad\__init__.py", line 2, in <module>
from .adbase import set_defaults as pyad_setdefaults
File "c:\windows\temp\waptbsr9b4\pyad\adbase.py", line 3, in <module>
from builtins import object
ImportError: No module named builtins
2018-02-07 11:16:46,019 CRITICAL Package claret-fusioninventory not installed due to errors : ImportError: No module named builtins
2018-02-07 11:16:46,019 CRITICAL Exception: Error during install of claret-fusioninventory: errors in packages [[u'claret-fusioninventory', PackageEntry('claret-fusioninventory','2.3.21-2')]]
Thank you for the example of the given code