Skip to content

Commit 3ab7712

Browse files
girijaasonichris1984
authored andcommitted
Add an exception for the missing storage field
1 parent 4ed502b commit 3ab7712

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/fog/vsphere/requests/compute/create_vm.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ def get_storage_pod_from_volumes(attributes)
125125
def vm_path_name(attributes)
126126
return '' if get_storage_pod_from_volumes(attributes)
127127
datastore = attributes[:volumes].first.datastore unless attributes[:volumes].empty?
128-
datastore ||= 'datastore1'
129-
"[#{datastore}]"
128+
if datastore
129+
"[#{datastore}]"
130+
else
131+
raise ArgumentError, 'Please mention the storage pod or the datastore'
132+
end
130133
end
131134

132135
def device_change(attributes)

0 commit comments

Comments
 (0)