Class: Inspec::Resources::LinuxFileSystemResource
- Inherits:
-
FsManagement
- Object
- FsManagement
- Inspec::Resources::LinuxFileSystemResource
- Defined in:
- lib/resources/filesystem.rb
Instance Attribute Summary
Attributes inherited from FsManagement
Instance Method Summary collapse
Methods inherited from FsManagement
Constructor Details
This class inherits a constructor from Inspec::Resources::FsManagement
Instance Method Details
#info(partition) ⇒ Object
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/resources/filesystem.rb', line 69 def info(partition) cmd = inspec.command("df #{partition} --output=size") raise Inspec::Exceptions::ResourceFailed, "Unable to get available space for partition #{partition}" if cmd.stdout.nil? || cmd.stdout.empty? || !cmd.exit_status.zero? value = cmd.stdout.gsub(/\dK-blocks[\r\n]/, '').strip { name: partition, size: value.to_i, type: false, } end |