lib/d3/client/receipt.rb in depot3-3.0.22 vs lib/d3/client/receipt.rb in depot3-3.0.26

- old
+ new

@@ -644,11 +644,11 @@ # if it is still on the server... if JSS::Package.all_ids.include? @id # uninstall the pkg D3.log "Running 'jamf uninstall' of #{edition}", :debug - uninstall_worked = JSS::Package.new(:id => @id).uninstall(:verbose => verbose).exitstatus == 0 + uninstall_worked = JSS::Package.fetch(:id => @id).uninstall(:verbose => verbose).exitstatus == 0 # if it isn't on the server any more.... else D3.log "Package is gone from server, no index available", :info @@ -713,11 +713,11 @@ ### def run_pre_remove (verbose = false) D3::Client.set_env :pre_remove, edition D3.log "Running pre_remove script", :debug begin - result = JSS::Script.new(:id => @pre_remove_script_id).run :verbose => verbose, :show_output => verbose + result = JSS::Script.fetch(:id => @pre_remove_script_id).run :verbose => verbose, :show_output => verbose rescue D3::ScriptError raise PreRemoveError, $! ensure D3::Client.unset_env :pre_remove end @@ -733,11 +733,11 @@ ### def run_post_remove (verbose = false) D3::Client.set_env :post_remove, edition D3.log "Running post_remove script", :debug begin - result = JSS::Script.new(:id => @post_remove_script_id).run :verbose => verbose, :show_output => verbose + result = JSS::Script.fetch(:id => @post_remove_script_id).run :verbose => verbose, :show_output => verbose rescue D3::ScriptError raise PostRemoveError, $! ensure D3::Client.unset_env :post_remove end @@ -798,10 +798,10 @@ ### @return [void] ### def repair raise JSS::UnsupportedError, "This receipt has been deleted" if @deleted - d3_pkg = D3::Package.new :id => @id + d3_pkg = D3::Package.fetch :id => @id @basename = d3_pkg.basename @version = d3_pkg.version @revision = d3_pkg.revision @admin ||= "Repaired"