mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 13:15:14 +09:00
F #4913: No need to specify DC_REF in rm
This commit is contained in:
1 parent
9f775e8587
commit
c03809e924
1 file changed
+2
-4
@@ -53,20 +53,18 @@ drv_action.initialize_xml(Base64.decode64(drv_action_enc), 'DS_DRIVER_ACTION_DAT
|
||||
|
||||
ds_ref = drv_action["/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VCENTER_DS_REF"]
|
||||
host_id = drv_action["/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VCENTER_CLUSTER"]
|
||||
dc_ref = drv_action["/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VCENTER_DC_REF"]
|
||||
img_src = drv_action["/DS_DRIVER_ACTION_DATA/IMAGE/SOURCE"]
|
||||
|
||||
check_valid ds_ref, "ds_ref"
|
||||
check_valid host_id, "vcenter_cluster"
|
||||
check_valid img_src, "img_src"
|
||||
check_valid dc_ref, "dc_ref"
|
||||
|
||||
begin
|
||||
vi_client = VCenterDriver::VIClient.new_from_host(host_id)
|
||||
dc = VCenterDriver::Datacenter.new_from_ref(dc_ref, vi_client)
|
||||
ds = VCenterDriver::Datastore.new_from_ref(ds_ref, vi_client)
|
||||
|
||||
ds.delete_virtual_disk(dc, img_src)
|
||||
ds.delete_virtual_disk(img_src)
|
||||
|
||||
rescue Exception => e
|
||||
STDERR.puts "Error deleting virtual disk #{img_src}."\
|
||||
" Reason: #{e.message}"
|
||||
|
||||
Reference in new issue
Block a user