From b5984bcad05f2d935e78826af3b5b0e9b8f455a9 Mon Sep 17 00:00:00 2001 From: Patrice Clement Date: Fri, 23 Jun 2017 15:46:02 +0200 Subject: define needed_vars array as a global variable --- src/java_config_2/VM.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/java_config_2/VM.py b/src/java_config_2/VM.py index abd6fb5..4709e37 100644 --- a/src/java_config_2/VM.py +++ b/src/java_config_2/VM.py @@ -9,17 +9,16 @@ from .Errors import * import os -class VM: - # Dont accept env files without these variables - needed_vars = [ "JAVA_HOME", "PROVIDES_TYPE", "PROVIDES_VERSION" ] +# Dont accept env files without these variables +NEEDED_VARS = [ "JAVA_HOME", "PROVIDES_TYPE", "PROVIDES_VERSION" ] +class VM: def __init__(self, file): self.file = file self.config = EnvFileParser(file).get_config() - - for var in self.needed_vars: + for var in NEEDED_VARS: if var not in self.config: - raise InvalidVMError("Missing: %s" %var) + raise InvalidVMError("Missing: %s" % var) def __eq__(self, other): return self.version() == other.version() -- cgit v1.2.3-65-gdbad