Skip to content

Commit

Permalink
Merge pull request #221 from jrafanie/drop_dump_warning
Browse files Browse the repository at this point in the history
Both pg_dump and pg_basebackup are supported ways to backup the database
  • Loading branch information
kbrock committed Oct 23, 2023
2 parents 0b5f92d + 17ac0cd commit fa1aa07
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
9 changes: 0 additions & 9 deletions lib/manageiq/appliance_console/database_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ class DatabaseAdmin < HighLine
Example: 'mydomain.com/user'
PROMPT

DB_DUMP_WARNING = <<-WARN.strip_heredoc
WARNING: This is not the recommended and supported way of running a
database backup, and is strictly meant for exporting a database for
support/debugging purposes!
WARN

attr_reader :action, :backup_type, :database_opts, :delete_agree, :filename

def initialize(action = :restore, input = $stdin, output = $stdout)
Expand All @@ -43,7 +35,6 @@ def ask_questions
press_any_key
raise MiqSignalError
end
say(DB_DUMP_WARNING) if action == :dump
ask_file_location
ask_for_tables_to_exclude_in_dump
end
Expand Down
29 changes: 1 addition & 28 deletions spec/database_admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -461,40 +461,13 @@ def confirm_and_execute
subject { described_class.new(:dump, input, output) }

describe "#ask_questions" do
let(:pg_dump_warning) do
<<-WARN.strip_heredoc
WARNING: This is not the recommended and supported way of running a
database backup, and is strictly meant for exporting a database for
support/debugging purposes!
WARN
end

it "warns about using pg_dump and asks for file location" do
it "asks for file location and tables to exclude" do
expect(subject).to receive(:say).with("Create Database Dump\n\n")
expect(subject).to receive(:say).with(pg_dump_warning)
expect(subject).to receive(:ask_file_location)
expect(subject).to receive(:ask_for_tables_to_exclude_in_dump)

subject.ask_questions
end

it "has proper formatting for the pg_dump warning" do
allow(subject).to receive(:ask_file_location)
allow(subject).to receive(:ask_for_tables_to_exclude_in_dump)
subject.ask_questions

expect_output <<-PROMPT.strip_heredoc
Create Database Dump
WARNING: This is not the recommended and supported way of running a
database backup, and is strictly meant for exporting a database for
support/debugging purposes!
PROMPT
end
end

describe "#activate" do
Expand Down

0 comments on commit fa1aa07

Please sign in to comment.