12 from __future__
import print_function
13 from FetchMTTTool
import *
14 from distutils.spawn
import find_executable
28 FetchMTTTool.__init__(self)
30 self.
options[
'exec'] = (
None,
"Executable that should be in path")
31 self.
options[
'module'] = (
None,
"Modules (or lmod modules) to be loaded for accessing this package")
36 IPlugin.activate(self)
41 IPlugin.deactivate(self)
45 return "AlreadyInstalled"
48 lines = testDef.printOptions(self.
options)
58 if keyvals[
'exec']
is not None:
62 if keyvals[
'module']
is not None:
63 status,stdout,stderr = testDef.modcmd.loadModules(keyvals[
'modules'], testDef)
65 log[
'status'] = status
66 log[
'stderr'] = stderr
72 if not find_executable(keyvals[
'exec']):
74 log[
'stderr'] =
"Executable {0} not found".format(keyvals[
'exec'])
79 status,stdout,stderr = testDef.modcmd.unloadModules(keyvals[
'modules'], testDef)
81 log[
'status'] = status
82 log[
'stderr'] = stderr
90 status,stdout,stderr = testDef.modcmd.unloadModules(keyvals[
'modules'], testDef)
92 log[
'status'] = status
93 log[
'stderr'] = stderr