mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
Handle exception if not config file exists
This commit is contained in:
parent
bda732fc17
commit
4c1add6060
1 changed files with 6 additions and 1 deletions
|
|
@ -204,7 +204,12 @@ class Vmfloaty
|
|||
end
|
||||
|
||||
def read_config
|
||||
conf = YAML.load_file("#{Dir.home}/.vmfloaty.yml")
|
||||
conf = {}
|
||||
begin
|
||||
conf = YAML.load_file("#{Dir.home}/.vmfloaty.yml")
|
||||
rescue
|
||||
STDERR.puts "There was no config file at #{Dir.home}/.vmfloaty.yml"
|
||||
end
|
||||
conf
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue