示例#1
0
 def get_lambda_output_variable(self):
     out_lambda = []
     if utils.is_variable_in_environment('OUTPUT_LAMBDA'):
         utils.set_environment_variable("OUTPUT_LAMBDA_FILE", "/tmp/{0}/lambda_output".format(lambda_instance.request_id))
         out_lambda += self.parse_container_environment_variable("OUTPUT_LAMBDA_FILE", 
                                                                 utils.get_environment_variable("EXTRA_PAYLOAD"))
     return out_lambda      
示例#2
0
 def save_tmp_udocker_env(cls):
     #Avoid override global variables
     if utils.is_value_in_dict(os.environ, 'UDOCKER_TARBALL'):
         cls.udocker_tarball = os.environ['UDOCKER_TARBALL']
     if utils.is_value_in_dict(os.environ, 'UDOCKER_DIR'):
         cls.udocker_dir = os.environ['UDOCKER_DIR']
     # Set temporal global vars
     udocker_tarball = utils.resource_path(
         utils.join_paths(cls.lambda_code_files_path, "udocker",
                          "udocker-1.1.3.tar.gz"))
     utils.set_environment_variable('UDOCKER_TARBALL', udocker_tarball)
     utils.set_environment_variable(
         'UDOCKER_DIR', utils.join_paths(cls.scar_temporal_folder,
                                         "udocker"))
示例#3
0
 def restore_environ_var(cls, key, var):
     if var:
         utils.set_environment_variable(key, var)
     else:
         del os.environ[key]