added test for nil volume (verified that it fails without the bugfix)

This commit is contained in:
Oded Arbel
2021-08-19 22:36:18 +03:00
parent 3ec2128c3c
commit bc1e6c3a8c
2 changed files with 26 additions and 3 deletions

View File

@@ -32,9 +32,7 @@ module VagrantPlugins
)
domain = env[:machine].provider.driver.connection.servers.get(env[:machine].id.to_s)
root_disk = domain.volumes.select do |x|
!x.nil?
end.select do |x|
x.name == libvirt_domain.name + '.img'
!x.nil? && x.name == libvirt_domain.name + '.img'
end.first
raise Errors::NoDomainVolume if root_disk.nil?