- classpath = tools.helpers.run.user(args, command, output_return=True).strip()
- for line in classpath.splitlines():
- _, k, v = line.split(' ', 2)
- local_env[k] = v
+ allowed = ["CLASSPATH", "SYSTEMSERVER"]
+ try:
+ p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
+ out, _ = p.communicate()
+ if p.returncode == 0:
+ for line in out.decode().splitlines():
+ _, k, v = line.split(' ', 2)
+ if any(pattern in k for pattern in allowed):
+ local_env[k] = v
+ except:
+ pass