Skip to content

Commit 321c976

Browse files
committed
Fix frozen string errors
1 parent 311cef4 commit 321c976

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/puppet/provider/mysql.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def self.cmd_table(table)
145145
table_string = ''
146146

147147
# We can't escape *.* so special case this.
148-
table_string << if table == '*.*'
148+
table_string += if table == '*.*'
149149
'*.*'
150150
# Special case also for FUNCTIONs and PROCEDUREs
151151
elsif table.start_with?('FUNCTION ', 'PROCEDURE ')
@@ -160,7 +160,7 @@ def self.cmd_privs(privileges)
160160
return 'ALL PRIVILEGES' if privileges.include?('ALL')
161161
priv_string = ''
162162
privileges.each do |priv|
163-
priv_string << "#{priv}, "
163+
priv_string += "#{priv}, "
164164
end
165165
# Remove trailing , from the last element.
166166
priv_string.sub(%r{, $}, '')
@@ -170,7 +170,7 @@ def self.cmd_privs(privileges)
170170
def self.cmd_options(options)
171171
option_string = ''
172172
options.each do |opt|
173-
option_string << ' WITH GRANT OPTION' if opt == 'GRANT'
173+
option_string += ' WITH GRANT OPTION' if opt == 'GRANT'
174174
end
175175
option_string
176176
end

lib/puppet/provider/mysql_user/mysql.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ def password_hash=(string)
159159
else
160160
concat_name = @resource[:name]
161161
sql = "UPDATE mysql.user SET password = '', plugin = 'ed25519'"
162-
sql << ", authentication_string = '#{string}'"
163-
sql << " where CONCAT(user, '@', host) = '#{concat_name}'; FLUSH PRIVILEGES"
162+
sql += ", authentication_string = '#{string}'"
163+
sql += " where CONCAT(user, '@', host) = '#{concat_name}'; FLUSH PRIVILEGES"
164164
end
165165
self.class.mysql_caller(sql, 'system')
166166
elsif newer_than('mysql' => '5.7.6', 'percona' => '5.7.6', 'mariadb' => '10.2.0')
@@ -210,17 +210,17 @@ def plugin=(string)
210210
else
211211
concat_name = @resource[:name]
212212
sql = "UPDATE mysql.user SET password = '', plugin = '#{string}'"
213-
sql << ", authentication_string = '#{@resource[:password_hash]}'"
214-
sql << " where CONCAT(user, '@', host) = '#{concat_name}'; FLUSH PRIVILEGES"
213+
sql += ", authentication_string = '#{@resource[:password_hash]}'"
214+
sql += " where CONCAT(user, '@', host) = '#{concat_name}'; FLUSH PRIVILEGES"
215215
end
216216
elsif newer_than('mysql' => '5.7.6', 'percona' => '5.7.6', 'mariadb' => '10.2.0')
217217
sql = "ALTER USER #{merged_name} IDENTIFIED WITH '#{string}'"
218-
sql << " AS '#{@resource[:password_hash]}'" if string == 'mysql_native_password'
218+
sql += " AS '#{@resource[:password_hash]}'" if string == 'mysql_native_password'
219219
else
220220
# See https://bugs.mysql.com/bug.php?id=67449
221221
sql = "UPDATE mysql.user SET plugin = '#{string}'"
222-
sql << ((string == 'mysql_native_password') ? ", password = '#{@resource[:password_hash]}'" : ", password = ''")
223-
sql << " WHERE CONCAT(user, '@', host) = '#{@resource[:name]}'"
222+
sql += ((string == 'mysql_native_password') ? ", password = '#{@resource[:password_hash]}'" : ", password = ''")
223+
sql += " WHERE CONCAT(user, '@', host) = '#{@resource[:name]}'"
224224
end
225225

226226
self.class.mysql_caller(sql, 'system')

0 commit comments

Comments
 (0)