Merge pull request #2664 from mmatuska/vsphere_fix_nic_detection

[vsphere] fix broken detection of existing network interface type
This commit is contained in:
Wesley Beary 2014-02-27 09:29:15 -06:00
commit ba6e2f9498
1 changed files with 4 additions and 2 deletions

View File

@ -22,8 +22,10 @@ module Fog
# Assign server first to prevent race condition with persisted?
self.server_id = attributes.delete(:server_id)
if attributes.has_key? :type and attributes[:type].is_a? String then
attributes[:type] = Fog.class_from_string(attributes[:type], "RbVmomi::VIM")
if attributes.has_key? :type then
if attributes[:type].is_a? String then
attributes[:type] = Fog.class_from_string(attributes[:type], "RbVmomi::VIM")
end
else
attributes[:type] = Fog.class_from_string("VirtualE1000", "RbVmomi::VIM")
end