Skip to content

Commit cc6aed2

Browse files
committed
Fix missing escape and fix format
1 parent e6b98ff commit cc6aed2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

spec/classes/mysql_backup_mysqldump_spec.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,16 @@ class { 'mysql::server': }
7575
context 'with file_per_database and excludedatabases' do
7676
let(:params) do
7777
{
78-
'file_per_database' => true,
79-
'excludedatabases' => [ 'information_schema' ],
78+
'file_per_database' => true,
79+
'excludedatabases' => [ 'information_schema' ],
8080
}.merge(default_params)
8181
end
8282

83-
it { is_expected.to contain_file('mysqlbackup.sh').with_content(%r{grep -v.*information_schema}) }
83+
it {
84+
is_expected.to contain_file('mysqlbackup.sh').with_content(
85+
%r{grep -v.*information_schema},
86+
)
87+
}
8488
end
8589
end
8690
end

templates/mysqlbackup.sh.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ cleanup
8181
<% end -%>
8282
<% if @backupdatabases.empty? -%>
8383
<% if @file_per_database -%>
84-
mysql --defaults-extra-file=$TMPFILE -s -r -N -e 'SHOW DATABASES' <% if ! @excludedatabases.empty? %> | grep -v '^\(<% @excludedatabases.join('|') %>)$' <% end %> | while read dbname
84+
mysql --defaults-extra-file=$TMPFILE -s -r -N -e 'SHOW DATABASES' <% if ! @excludedatabases.empty? %> | grep -v '^\(<% @excludedatabases.join('|') %>\)$' <% end %> | while read dbname
8585
do
8686
<%= @backupmethod -%> --defaults-extra-file=$TMPFILE --opt --flush-logs --single-transaction \
8787
${ADDITIONAL_OPTIONS} \

0 commit comments

Comments
 (0)