diff options
author | kali <kali@leap.se> | 2012-08-30 00:36:50 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-08-30 00:42:29 +0900 |
commit | 1263cd7a3cfca81ae3e6976a489e2d3d4013d64b (patch) | |
tree | 95e6897a949d8772248a52ee714eec19bd2c6e72 /src/leap/eip/specs.py | |
parent | ed4ad3a392caf0211e51a48d2d7b6c5a2f7bb17a (diff) |
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 :)
Diffstat (limited to 'src/leap/eip/specs.py')
-rw-r--r-- | src/leap/eip/specs.py | 14 |
1 files changed, 8 insertions, 6 deletions
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 }, |