From 1263cd7a3cfca81ae3e6976a489e2d3d4013d64b Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 30 Aug 2012 00:36:50 +0900 Subject: add lazy evaluation to config specs now callables are allowed in specs *only at one level depth* to allow for last-minute evaluation on context-sensitive data, like paths affected by os.environ also some minor modifications to make check tests pass after putting the new jsonconfig-based eipconfig in place. aaaaaall green again :) --- src/leap/eip/specs.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/leap/eip/specs.py') diff --git a/src/leap/eip/specs.py b/src/leap/eip/specs.py index 572177dd..a39e5979 100644 --- a/src/leap/eip/specs.py +++ b/src/leap/eip/specs.py @@ -1,19 +1,21 @@ +from __future__ import (unicode_literals) import os from leap.base import config as baseconfig -provider_ca_path = os.path.join( +provider_ca_path = lambda: unicode(os.path.join( baseconfig.get_default_provider_path(), 'keys', 'ca', 'testprovider-ca-cert.pem' -) +)) -client_cert_path = os.path.join( + +client_cert_path = lambda: unicode(os.path.join( baseconfig.get_default_provider_path(), 'keys', 'client', 'openvpn.pem' -) +)) eipconfig_spec = { 'provider': { @@ -33,7 +35,7 @@ eipconfig_spec = { 'type': int, 'default': 80 }, - 'oepnvpn_ca_certificate': { + 'openvpn_ca_certificate': { 'type': unicode, # path 'default': provider_ca_path }, @@ -45,7 +47,7 @@ eipconfig_spec = { 'type': bool, 'default': True }, - 'block_cleartext_tr affic': { + 'block_cleartext_traffic': { 'type': bool, 'default': True }, -- cgit v1.2.3