class LicenseAcceptance::Strategy::Prompt
def request(missing_licenses, &persist_callback)
def request(missing_licenses, &persist_callback) logger.debug("Requesting a license for #{missing_licenses.map(&:id)}") c = missing_licenses.size s = c > 1 ? "s" : "" acceptance_question = "Do you accept the #{c} product license#{s} (#{YES}/no)?" output.puts <<~EOM #{BORDER} Chef License Acceptance Before you can continue, #{c} product license#{s} must be accepted. View the license at https://www.chef.io/end-user-license-agreement/ License#{s} that need accepting: * #{missing_licenses.map(&:pretty_name).join("\n * ")} #{acceptance_question} EOM if ask(output, c, s, persist_callback) output.puts BORDER return true end output.puts <<~EOM If you do not accept this license you will not be able to use Chef products. #{acceptance_question} EOM answer = ask(output, c, s, persist_callback) if answer != "yes" output.puts BORDER end answer end