Sha256: 1101e082f42085a138b166faa3d2d99c1610912d6676b67876c9d151e3870275
Contents?: true
Size: 920 Bytes
Versions: 66
Compression:
Stored size: 920 Bytes
Contents
require 'fs/MiqFS/MiqFS' module LinuxMountProbe LINUX_FS_TYPES = %w( Ext3 ext3 Ext4 ext4 ReiserFS XFS ) LINUX_ROOT_DIRS = ["bin", "dev", "etc", "lib", "proc", "sbin", "usr"] LINUX_ROOT_FILES = ["/etc/fstab"] def self.probe(fs) unless LINUX_FS_TYPES.include?(fs.fsType) $log.info "LinuxMountProbe << FALSE because file system (#{fs.fsType}) is not supported" if $log return false end if (fs.dirEntries & LINUX_ROOT_DIRS).length != LINUX_ROOT_DIRS.length $log.debug "LinuxMountProbe << FALSE because root directories (#{LINUX_ROOT_DIRS.inspect}) missing in: #{fs.dirEntries.inspect}" if $log return false end LINUX_ROOT_FILES.each do |f| unless fs.fileExists?(f) $log.info "LinuxMountProbe << FALSE because file #{f} does not exist" if $log return false end end $log.debug "LinuxMountProbe << TRUE" if $log true end end
Version data entries
66 entries across 66 versions & 1 rubygems