mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
(rubocop) Fix Style/RescueStandardError
This commit is contained in:
parent
7bafee35a7
commit
12c1795046
2 changed files with 4 additions and 4 deletions
|
|
@ -8,7 +8,7 @@ class Conf
|
||||||
conf = {}
|
conf = {}
|
||||||
begin
|
begin
|
||||||
conf = YAML.load_file("#{Dir.home}/.vmfloaty.yml")
|
conf = YAML.load_file("#{Dir.home}/.vmfloaty.yml")
|
||||||
rescue
|
rescue StandardError
|
||||||
STDERR.puts "WARNING: There was no config file at #{Dir.home}/.vmfloaty.yml"
|
STDERR.puts "WARNING: There was no config file at #{Dir.home}/.vmfloaty.yml"
|
||||||
end
|
end
|
||||||
conf
|
conf
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ class Utils
|
||||||
else
|
else
|
||||||
raise "Invalid service type #{service.type}"
|
raise "Invalid service type #{service.type}"
|
||||||
end
|
end
|
||||||
rescue => e
|
rescue StandardError => e
|
||||||
STDERR.puts("Something went wrong while trying to gather information on #{hostname}:")
|
STDERR.puts("Something went wrong while trying to gather information on #{hostname}:")
|
||||||
STDERR.puts(e)
|
STDERR.puts(e)
|
||||||
end
|
end
|
||||||
|
|
@ -128,7 +128,7 @@ class Utils
|
||||||
missing = max - ready - pending
|
missing = max - ready - pending
|
||||||
char = 'o'
|
char = 'o'
|
||||||
puts "#{name.ljust(width)} #{(char*ready).green}#{(char*pending).yellow}#{(char*missing).red}"
|
puts "#{name.ljust(width)} #{(char*ready).green}#{(char*pending).yellow}#{(char*missing).red}"
|
||||||
rescue => e
|
rescue StandardError => e
|
||||||
puts "#{name.ljust(width)} #{e.red}"
|
puts "#{name.ljust(width)} #{e.red}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -147,7 +147,7 @@ class Utils
|
||||||
missing = max - ready - pending
|
missing = max - ready - pending
|
||||||
char = 'o'
|
char = 'o'
|
||||||
puts "#{name.ljust(width)} #{(char*ready).green}#{(char*pending).yellow}#{(char*missing).red}"
|
puts "#{name.ljust(width)} #{(char*ready).green}#{(char*pending).yellow}#{(char*missing).red}"
|
||||||
rescue => e
|
rescue StandardError => e
|
||||||
puts "#{name.ljust(width)} #{e.red}"
|
puts "#{name.ljust(width)} #{e.red}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue