fixed a volume bug when assign a not existing disk

Change-Id: Iaa6d0faffbd3fdc79ee4931bd5ec61daa685db27
This commit is contained in:
SamSu 2014-03-28 12:00:07 -07:00
parent 9f27829f52
commit 697caf28e8

View File

@ -136,16 +136,20 @@ def create_disk_partition resource
end
action :create_partition do
if node['partitions'].nil? or not node['partitions'].any?{|s| s.include?(new_resource.device)}
disk_total_size new_resource
partition_start_size new_resource
if new_resource.start_size.eql?(new_resource.total_size)
create_file_partition new_resource
else
create_disk_partition new_resource
if ::File.exist?(new_resource.device)
if node['partitions'].nil? or not node['partitions'].any?{|s| s.include?(new_resource.device)}
disk_total_size new_resource
partition_start_size new_resource
if new_resource.start_size.eql?(new_resource.total_size)
create_file_partition new_resource
else
create_disk_partition new_resource
end
end
new_resource.updated_by_last_action(true)
else
create_file_partition new_resource
end
new_resource.updated_by_last_action(true)
end
action :mk_cinder_vol do