libraries/provider_lvm_logical_volume.rb
# Checks if the device is formatted with the given file system type
#
# @param device_name [String] the device name
# @param fs_type [String] the file system type
#
# @return [Boolean] whether the device is formatted with the given file
#   system type or not
#
Checks if the device is formatted with the given file system type
Checks if the device is formatted with the given file system type
def device_formatted?(device_name, fs_type)
        Chef::Log.debug "Checking to see if #{device_name} is formatted..."
        blkid = shell_out("blkid -o value -s TYPE #{device_name}")
        blkid.exitstatus == 0 && blkid.stdout.strip == fs_type.strip
      end
def device_formatted? ( device_name , fs_type ) Chef :: Log . debug "Checking to see if #{device_name} is formatted..." blkid = shell_out ( "blkid -o value -s TYPE #{device_name}" ) blkid . exitstatus == 0 && blkid . stdout . strip == fs_type . strip end
Checks if the device is formatted with the given file system type
Checks if the device is formatted with the given file system type
# Do not raise when there is an error in running the blkid command. If the exitstatus is not 0, # the device is perhaps not formatted.
whether the device is formatted with the given file system type or not
whether the device is formatted with the given file system type or not
Boolean
device_name
the device name
the device name
fs_type
the file system type
the file system type