Class: BrpmScriptExecutor

Inherits:
Object
  • Object
show all
Defined in:
lib/brpm_script_executor.rb

Class Method Summary collapse

Class Method Details

.execute_automation_script(modul, name, params) ⇒ Object



9
10
11
# File 'lib/brpm_script_executor.rb', line 9

def execute_automation_script(modul, name, params)
  execute_automation_script_internal(modul, name, params, "automation")
end

.execute_automation_script_from_other_process(modul, name, params_file, automation_type, parent_id = nil, offset = nil, max_records = nil) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/brpm_script_executor.rb', line 25

def execute_automation_script_from_other_process(modul, name, params_file, automation_type, parent_id = nil, offset = nil, max_records = nil)
  raise "Params file #{params_file} doesn't exist." unless File.exists?(params_file)

  puts "Loading params file #{params_file}..."
  params = YAML.load_file(params_file)

  puts "Loading the BRPM Content framework..."
  BrpmAuto.setup(params)
  BrpmAuto.log "The BRPM Content framework is loaded now. (version: #{BrpmAuto.version})"

  BrpmAuto.log "Deleting params file #{params_file}..."
  FileUtils.rm(params_file)

  if params["SS_run_key"] and params["SS_script_support_path"]
    BrpmAuto.log "Loading script_support libraries..."
    require "#{params["SS_script_support_path"]}/ssh_script_header.rb"
    require "#{params["SS_script_support_path"]}/script_helper.rb"
    require "#{params["SS_script_support_path"]}/file_in_utf.rb"
  end

  execute_automation_script_internal(modul, name, params, automation_type, parent_id, offset, max_records)
end

.execute_automation_script_in_separate_process(modul, name, params) ⇒ Object



17
18
19
# File 'lib/brpm_script_executor.rb', line 17

def execute_automation_script_in_separate_process(modul, name, params)
  execute_automation_script_in_separate_process_internal(modul, name, params, "automation")
end

.execute_resource_automation_script(modul, name, params, parent_id, offset, max_records) ⇒ Object



13
14
15
# File 'lib/brpm_script_executor.rb', line 13

def execute_resource_automation_script(modul, name, params, parent_id, offset, max_records)
  execute_automation_script_internal(modul, name, params, "resource_automation", parent_id, offset, max_records)
end

.execute_resource_automation_script_in_separate_process(modul, name, params, parent_id, offset, max_records) ⇒ Object



21
22
23
# File 'lib/brpm_script_executor.rb', line 21

def execute_resource_automation_script_in_separate_process(modul, name, params, parent_id, offset, max_records)
  execute_automation_script_in_separate_process_internal(modul, name, params, "resource_automation", parent_id, offset, max_records)
end