Sha256: 25af39f614ccfcce8eb1dba1b100d575ca6fd47601fb3c52b0ddbfeb9d934dd9

Contents?: true

Size: 579 Bytes

Versions: 52

Compression:

Stored size: 579 Bytes

Contents

require 'fs/ext4/superblock'

module Ext4Probe
  def self.probe(dobj)
    unless dobj.kind_of?(MiqDisk)
      $log&.debug("Ext4Probe << FALSE because Disk Object class is not MiqDisk, but is '#{dobj.class}'")
      return false
    end

    dobj.seek(0, IO::SEEK_SET)
    Ext4::Superblock.new(dobj)

    # If initializing the superblock does not throw any errors, then this is Ext4
    $log&.debug("Ext4Probe << TRUE")
    return true
  rescue => err
    $log&.debug("Ext4Probe << FALSE because #{err.message}")
    return false
  ensure
    dobj.seek(0, IO::SEEK_SET)
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
manageiq-smartstate-0.10.1 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.10.0 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.9.0 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.8.1 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.8.0 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.7.0 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.6.2 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.5.10 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.3.10 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.6.1 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.3.9 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.6.0 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.5.9 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.5.8 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.3.8 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.5.7 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.3.7 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.5.6 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.3.6 lib/fs/MiqFS/modules/Ext4Probe.rb
manageiq-smartstate-0.5.5 lib/fs/MiqFS/modules/Ext4Probe.rb