Use YAML formatted variable file

master
Daniel Berteaud 5 years ago
parent 59e4fa1e05
commit b237290d6e
  1. 2
      WAPT/control
  2. 6
      setup.py

@ -1,5 +1,5 @@
package : fws-zabbix-agent package : fws-zabbix-agent
version : 4.0.1-3 version : 4.0.1-4
architecture : all architecture : all
section : base section : base
priority : optional priority : optional

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from setuphelpers import * from setuphelpers import *
import json
from cryptography.fernet import Fernet
uninstallkey = [] uninstallkey = []
variables = { variables = {
@ -11,8 +9,10 @@ variables = {
# Read local variables file if available # Read local variables file if available
if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')): if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')):
print('Reading local encrypted variables file') print('Reading local encrypted variables file')
from cryptography.fernet import Fernet
import yaml
f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()) f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read())
variables.update(json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))) variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read())))
props = { props = {
'RMTCMD':0, 'RMTCMD':0,

Loading…
Cancel
Save