fixed a volume bug when assign a not existing disk
Change-Id: Iaa6d0faffbd3fdc79ee4931bd5ec61daa685db27
This commit is contained in:
parent
9f27829f52
commit
697caf28e8
@ -136,6 +136,7 @@ def create_disk_partition resource
|
||||
end
|
||||
|
||||
action :create_partition do
|
||||
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
|
||||
@ -144,8 +145,11 @@ action :create_partition do
|
||||
else
|
||||
create_disk_partition new_resource
|
||||
end
|
||||
new_resource.updated_by_last_action(true)
|
||||
end
|
||||
else
|
||||
create_file_partition new_resource
|
||||
end
|
||||
new_resource.updated_by_last_action(true)
|
||||
end
|
||||
|
||||
action :mk_cinder_vol do
|
||||
|
Loading…
x
Reference in New Issue
Block a user