1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[opennebula] raise an ArgumentError if VM name is empty/nil

This commit is contained in:
Achim Ledermüller 2014-05-13 13:47:49 +02:00
parent 03980861d6
commit 52f5473193

View file

@ -5,7 +5,10 @@ module Fog
def vm_allocate(attr={ })
if(attr[:flavor].nil?)
raise(ArgumentError.new("Attribute flavor is nil or empty! #{attr.inspect}"))
raise(ArgumentError.new("Attribute flavor is nil! #{attr.inspect}"))
end
if(attr[:name].nil? || attr[:name].empty?)
raise(ArgumentError.new("Attribute name is nil or empty! #{attr.inspect}"))
end
xml = ::OpenNebula::VirtualMachine.build_xml