do not log sensitive commands during backup/restore
This commit is contained in:
parent
2735f286c4
commit
8c89931747
|
@ -122,9 +122,6 @@ module Export
|
|||
def dump_public_schema
|
||||
log "Dumping the public schema of the database..."
|
||||
|
||||
pg_dump_command = build_pg_dump_command
|
||||
log "Running: #{pg_dump_command}"
|
||||
|
||||
logs = Queue.new
|
||||
pg_dump_running = true
|
||||
|
||||
|
@ -151,7 +148,7 @@ module Export
|
|||
raise "pg_dump failed" unless $?.success?
|
||||
end
|
||||
|
||||
def build_pg_dump_command
|
||||
def pg_dump_command
|
||||
db_conf = BackupRestore.database_configuration
|
||||
|
||||
password_argument = "PGPASSWORD=#{db_conf.password}" if db_conf.password.present?
|
||||
|
@ -174,14 +171,10 @@ module Export
|
|||
def update_dump
|
||||
log "Updating dump for more awesomeness..."
|
||||
|
||||
sed_command = build_sed_command
|
||||
|
||||
log "Running: #{sed_command}"
|
||||
|
||||
`#{sed_command}`
|
||||
end
|
||||
|
||||
def build_sed_command
|
||||
def sed_command
|
||||
# in order to limit the downtime when restoring as much as possible
|
||||
# we force the restoration to happen in the "restore" schema
|
||||
|
||||
|
|
|
@ -167,9 +167,6 @@ module Import
|
|||
def restore_dump
|
||||
log "Restoring dump file... (can be quite long)"
|
||||
|
||||
psql_command = build_psql_command
|
||||
log "Running: #{psql_command}"
|
||||
|
||||
logs = Queue.new
|
||||
psql_running = true
|
||||
has_error = false
|
||||
|
@ -199,7 +196,7 @@ module Import
|
|||
raise "psql failed" if has_error
|
||||
end
|
||||
|
||||
def build_psql_command
|
||||
def psql_command
|
||||
db_conf = BackupRestore.database_configuration
|
||||
|
||||
password_argument = "PGPASSWORD=#{db_conf.password}" if db_conf.password.present?
|
||||
|
|
Loading…
Reference in New Issue