def execute_script(script_path, *arguments)
      # If we are running a ruby script, use our own interpreter
      if File.extname(script_path) == '.rb'
        cmd = ::RightScale::Platform.shell.format_executable_command(
          RightScale::AgentConfig.ruby_cmd,
          *([script_path] + arguments))
      else
        cmd = ::RightScale::Platform.shell.format_shell_command(
          script_path,
          *arguments)
      end
      output = `#{cmd}`
      return ActionResult.new(:exitstatus => $?.exitstatus, :output => output)
    rescue Exception => e
      return ActionResult.new(:exitstatus => 1, :error => "ERROR: #{e.message}", :exception => e)
    end
def execute_script(script_path, *arguments)
      # If we are running a ruby script, use our own interpreter
      if File.extname(script_path) == '.rb'
        cmd = ::RightScale::Platform.shell.format_executable_command(
          RightScale::AgentConfig.ruby_cmd,
          *([script_path] + arguments))
      else
        cmd = ::RightScale::Platform.shell.format_shell_command(
          script_path,
          *arguments)
      end
      output = `#{cmd}`
      return ActionResult.new(:exitstatus => $?.exitstatus, :output => output)
    rescue Exception => e
      return ActionResult.new(:exitstatus => 1, :error => "ERROR: #{e.message}", :exception => e)
    end
Called internally to execute a cloud extension script with the given
 command-line arguments, if any. It is generally assumed scripts will not
 exit until finished and will read any instance-specific information from
 the system or from the output of write_metadata.

 === Parameters
 script_path(String):: path to script to execute
 arguments(Array):: arguments for script command line or empty

 === Return
 result(ActionResult):: action result