Commit a50d80af authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(backend): cope with already removed volumes

parent b31831bd
......@@ -339,7 +339,8 @@ sub _disk_device($self, $with_info=undef, $attribute=undef, $value=undef) {
my ($boot_node) = $disk->findnodes('boot');
my $info = {};
$info = $self->_volume_info($file) if $file && $device eq 'disk';
eval { $info = $self->_volume_info($file) if $file && $device eq 'disk' };
die $@ if $@ && $@ !~ /not found/i;
$info->{device} = $device;
if (!$info->{name} ) {
if ($file) {
......
......@@ -45,6 +45,12 @@ sub test_remove_domain_volumes_already_gone {
next if $file =~ /iso/;
unlink $file or die "$! $file";
}
$domain->storage_refresh() if $vm->type ne 'Void';
my @volumes = $domain->list_volumes_info();
for my $vol (@volumes) {
next if $vol->file =~ /\.iso$/;
ok(!-e $vol->file);
}
eval { $domain->remove(user_admin) };
is(''.$@,'',$vm->type);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment