Revision 493d48ce src/datastore_mad/remotes/vcenter/rm

View differences:

src/datastore_mad/remotes/vcenter/rm
52 52

  
53 53
    ds = VCenterDriver::Datastore.new_from_ref(ds_ref, vi_client)
54 54

  
55
    ds.delete_virtual_disk(img_src)
55
    img_dir = img_src.split('/')[0..-2].join('/')
56 56

  
57
    ds.delete_virtual_disk(img_src)
58
    ds.rm_directory(img_dir) if ds.dir_empty?(img_dir)
57 59
rescue Exception => e
58 60
    STDERR.puts "Error deleting virtual disk #{img_src}."\
59 61
                " Reason: \"#{e.message}\"\n#{e.backtrace}"

Also available in: Unified diff