lib/d3/package/client_actions.rb in depot3-3.0.22 vs lib/d3/package/client_actions.rb in depot3-3.0.26
- old
+ new
@@ -35,13 +35,13 @@
###
def run_make_live_script
# Run the make_live script if any
if script = D3::CONFIG.admin_make_live_script
if JSS::Script.all_names.include? script
- code = JSS::Script.new(name: script).code
+ code = JSS::Script.fetch(name: script).code
elsif JSS::Script.all_ids.include? script
- code = JSS::Script.new(id: script).code
+ code = JSS::Script.fetch(id: script).code
else
return nil
end
return nil unless code
@@ -257,11 +257,11 @@
def run_pre_install_script(verbose = false)
return 0 unless pre_install_script?
begin
D3::Client.set_env :pre_install, edition
D3.log "Running pre_install script for #{edition}", :info
- (exit_status, output) = JSS::Script.new(:id => @pre_install_script_id).run :verbose => verbose, :show_output => verbose
+ (exit_status, output) = JSS::Script.fetch(:id => @pre_install_script_id).run :verbose => verbose, :show_output => verbose
D3.log "Finished pre_install script for #{edition}", :debug
rescue D3::ScriptError
raise PreInstallError, $!
ensure
D3::Client.unset_env :pre_install
@@ -278,10 +278,10 @@
def run_post_install_script(verbose = false)
return 0 unless post_install_script?
begin
D3::Client.set_env :post_install, edition
D3.log "Running post_install script for #{edition}", :info
- (exit_status, output) = JSS::Script.new(:id => @post_install_script_id).run :verbose => verbose, :show_output => verbose
+ (exit_status, output) = JSS::Script.fetch(:id => @post_install_script_id).run :verbose => verbose, :show_output => verbose
D3.log "Finished post_install script for #{edition}", :debug
rescue D3::ScriptError
raise PostInstallError, $!
ensure
D3::Client.unset_env :post_install