pymtt
 All Classes Namespaces Files Functions Variables Groups
Environ.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
4 # $COPYRIGHT$
5 #
6 # Additional copyrights may follow
7 #
8 # $HEADER$
9 #
10 
11 from __future__ import print_function
12 import shutil
13 import os
14 from BaseMTTUtility import *
15 
16 ## @addtogroup Utilities
17 # @{
18 # @section Environ
19 # Set environment variables
20 # @}
22  def __init__(self):
23  BaseMTTUtility.__init__(self)
24  self.options = {}
25 
26  def print_name(self):
27  return "Environ"
28 
29  def print_options(self, testDef, prefix):
30  lines = testDef.printOptions(self.options)
31  for line in lines:
32  print(prefix + line)
33  return
34 
35  def execute(self, log, keyvals, testDef):
36  testDef.logger.verbose_print("Environ Execute")
37 
38  # Set any provided key values
39  kvkeys = keyvals.keys()
40  for kvkey in kvkeys:
41  os.environ[kvkey] = keyvals[kvkey]
42  log['status'] = 0
43  log['environ'] = keyvals
44  return
def print_options
Definition: Environ.py:29
def print_name
Definition: Environ.py:26