aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/java_config/EnvironmentManager.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/java_config/EnvironmentManager.py b/src/java_config/EnvironmentManager.py
index 47f6e31..49b5263 100644
--- a/src/java_config/EnvironmentManager.py
+++ b/src/java_config/EnvironmentManager.py
@@ -128,6 +128,20 @@ class EnvironmentManager:
else:
return None
+ def create_env_entry(self, vm, stream, render="%s=%s\n"):
+ stream.write("# Autogenerated by java-config\n")
+ stream.write("# Java Virtual Machine: %s\n\n" % vm.query('VERSION'))
+
+ try:
+ ENV_VARS = vm.query('ENV_VARS')
+ for (item, value) in vm.get_config().iteritems():
+ if item in ENV_VARS:
+ stream.write(render % (item, value))
+ except IOError:
+ raise PermissionError
+ except EnvironmentUndefinedError:
+ raise EnvironmentUndefinedError
+
def set_user_vm(self, vm):
self.set_vm(vm, self.user_vm_link())