Make local var file optional and fusinv_servers is now a list

master
Daniel Berteaud 6 years ago
parent b623bb0d47
commit 2ab6e8c464
  1. 45
      WAPT/control
  2. 25
      setup.py

@ -1,33 +1,32 @@
package : fws-fusioninventory
version : 2.4.2-4
version : 2.4.2-8
architecture : all
section : base
priority : optional
maintainer : Kevin Guerineau
description : FusionInventory is a software for inventory computers.
depends :
conflicts :
maturity :
description : FusionInventory is a computer inventory agent
depends :
conflicts :
maturity : DEV
locale : all
target_os : windows
min_os_version : 5.0
max_os_version :
max_os_version :
min_wapt_version : 1.3.12
sources :
installed_size :
impacted_process :
description_fr : FusionInventory est un logiciel d'inventaire d'ordinateurs
description_pl :
description_de :
description_es :
sources :
installed_size :
impacted_process :
description_fr : FusionInventory est un agent d'inventaire d'ordinateurs
description_pl :
description_de :
description_es :
audit_schedule : 4w
editor :
keywords :
licence :
homepage :
package_uuid : 8151a535-59a4-4951-bb82-c3f7c98644f5
signer : Daniel Berteaud
signer_fingerprint: 3c9415559e2dedbc4390e3faa2c28d3b67265baa5b35902d2764d9e41c3b3f0a
signature : S189A65mxvE2N/PLheSzz8Hm431rKfUPe7FCUaeybLGeq8R1Z8z6rhgHMm5KU0wdckeAC6lgKsnhQY6rEvedxE7GPtoC3LOLmdUkzj7rjB7rVOObyafJaobjTgJRlDIirK4YBg6/sebuv0SDcBU+IrPt7SRlHjb+q2+S0KlagPsKpFLGBgnXZQZzX0M7t25twZP64S7Zqw0qRjojy3BFdUizvOB47ZwMHZqdGdDnFrIsDHrDcIYsKl/0Cf91Fj0KPTl12F6EhMRllTxoAQOevgP+uEh2gZ78Oq+uEv/IWywTQlp4MIiX16KLjaXerFUjNPjwHwWQgmLDQUUENAfECg==
signature_date : 20181123-101110
signed_attributes : package,version,architecture,section,priority,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,audit_schedule,editor,keywords,licence,homepage,package_uuid,signer,signer_fingerprint,signature_date,signed_attributes
editor :
keywords :
licence : GPLv2+
homepage : http://fusioninventory.org/
package_uuid :
signer :
signer_fingerprint:
signature_date :
signed_attributes :

@ -5,25 +5,22 @@ import json
uninstallkey = []
print('Reading variables')
key = open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()
f = Fernet(key)
variables = json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))
if not 'fusinv_server' in variables:
error('Missing fusinv_server variable')
variables = {
'fusinv_servers': [ 'https://glpi.lan.local/plugins/fusioninventory' ]
}
# Read local variables file if available
if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')):
print('Reading local encrypted variables file')
f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read())
variables = json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))
def install():
print('Reading variables')
key = open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()
f = Fernet(key)
variables = json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))
if not 'fusinv_server' in variables:
error('Missing fusinv_server variable')
parameters = '/S /acceptlicense /server="%s" /execmode=service /runnow' % (variables['fusinv_server'])
parameters = '/S /acceptlicense /server="%s" /execmode=service /runnow' % (','.join(variables['fusinv_servers']))
if 'fusinv_user' in variables and 'fusinv_pass' in variables:
parameters = parameters + ' /user="%s" /password="%s"' % (variables['fusinv_user'],variables['fusinv_pass'])
print('installing Fusion inventory agent')
print('Installing FusionInventory Agent')
versionpaquet = control['version'].split('-',1)[0]
if iswin64():
install_exe_if_needed("fusioninventory-agent_windows-x64_%s.exe" % versionpaquet,parameters,key='FusionInventory-Agent',min_version=versionpaquet)

Loading…
Cancel
Save