Revision 47a5a6ba

View differences:

src/datastore_mad/remotes/vcenter/rm
48 48
check_valid host_id, "vcenter_cluster"
49 49
check_valid img_src, "img_src"
50 50

  
51
CDROM = "1"
52

  
51 53
begin
52 54
    #TODO should imported disks be deleted?
53 55
    if imported.nil? || imported.empty?
......
57 59

  
58 60
        img_dir = img_src.split('/')[0..-2].join('/')
59 61

  
60
        ds.delete_virtual_disk(img_src)
62
        img_type    = drv_action["/DS_DRIVER_ACTION_DATA/IMAGE/TYPE"]
63

  
64
        if img_type != CDROM
65
            # delete the disk
66
            ds.delete_virtual_disk(img_src)
67
        else
68
            # delete the CDROM iso
69
            ds.delete_file(img_src)
70
        end
71

  
61 72
        ds.rm_directory(img_dir) if ds.dir_empty?(img_dir)
62 73
    end
63 74
rescue Exception => e

Also available in: Unified diff