self.existing_raid_at?

in ebs/libraries/block_device.rb [55:71]


  def self.existing_raid_at?(device)
    raids = OpsWorks::ShellOut.shellout("mdadm --examine --scan")
    if raids.match(device) || raids.match(device.gsub(/md/, "md/"))
      Chef::Log.debug("Checking for existing RAID arrays at #{device}: #{raids}")
      Chef::Log.info("Checking for existing RAID arrays at #{device}: true")
      true
    else
      Chef::Log.debug("Checking for existing RAID arrays at #{device}: #{raids}")
      Chef::Log.info("Checking for existing RAID arrays at #{device}: false")
      false
    end
  rescue RuntimeError => e
    Chef::Log.debug("Checking for existing RAID arrays failed: #{e.class} - #{e.message} - #{e.backtrace.join("\n")}")
    Chef::Log.info("Checking for existing RAID arrays failed: #{e.message}")
    false
  end