Skip to content

Commit

Permalink
Fix Style/RedundantRegexpEscape cop
Browse files Browse the repository at this point in the history
  • Loading branch information
archanaserver committed Jan 16, 2024
1 parent 7767160 commit 389bc8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/host/discovered.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def lookup_value_match
end

def self.normalize_string_for_hostname(hostname)
hostname = hostname.to_s.downcase.gsub(/(^[^a-z0-9]*|[^a-z0-9\-]|[^a-z0-9]*$)/,'')
hostname = hostname.to_s.downcase.gsub(/(^[^a-z0-9]*|[^a-z0-9-]|[^a-z0-9]*$)/,'')
raise(::Foreman::Exception.new(N_("Invalid hostname: Could not normalize the hostname"))) unless hostname && hostname.present?
hostname
end
Expand Down

0 comments on commit 389bc8c

Please sign in to comment.