in cookbooks/fb_storage/libraries/storage_handlers.rb [81:106]
def wipe_device
Chef::Log.debug(
"fb_storage: wipe_device called on #{@device}",
)
umount_all_partitions
remove_all_partitions_from_all_arrays
existing_partitions.each do |part|
Chef::Log.info("fb_storage: Deleting #{part}")
pnum = part.sub(/
cmd = "/sbin/parted -s '#{@device}' rm #{pnum}"
Chef::Log.debug("fb_storage: running: #{cmd}")
s = Mixlib::ShellOut.new(cmd).run_command
if s.error?
if s.stderr.match(/unrecognised disk label/)
Chef::Log.debug(
'fb_storage: Allowing failed removal of ' +
"#{pnum} from #{@device} as the partition table is " +
'unrecognised.',
)
else
s.error!
end
end
end
end