From 12948e63c5e9969ae5ac37102d2c6fc57fe73316 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 20 Dec 2018 13:15:03 +0100 Subject: [PATCH] Use YAML formatted variable file --- WAPT/control | 2 +- setup.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/WAPT/control b/WAPT/control index c4cc263..fe59770 100644 --- a/WAPT/control +++ b/WAPT/control @@ -1,5 +1,5 @@ package : fws-backuppc-agent -version : 1.3.4-22 +version : 1.3.4-24 architecture : all section : base priority : optional diff --git a/setup.py b/setup.py index c01c246..7976475 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from setuphelpers import * -from cryptography.fernet import Fernet -import json, os, random, string, time +import os, random, string, time from jinja2 import Environment, FileSystemLoader uninstallkey = [] @@ -15,8 +14,10 @@ variables = { # 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') + from cryptography.fernet import Fernet + import yaml 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()))) # Create a random pass for the local backup account if not defined if not 'backup_pass' in variables: