Class: Inspec::Resources::UnixFileSystemResource
- Inherits:
-
FsManagement
- Object
- FsManagement
- Inspec::Resources::UnixFileSystemResource
- Defined in:
- lib/inspec/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
101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/inspec/resources/filesystem.rb', line 101 def info(partition) cmd = inspec.command("df #{partition} -PT") if cmd.stdout.nil? || cmd.stdout.empty? || cmd.exit_status != 0 raise Inspec::Exceptions::ResourceFailed, "Unable to get available space for partition #{partition}" end value = cmd.stdout.split(/\n/)[1].strip.split(" ") { name: partition, size_kb: value[2].to_i, free_kb: value[4].to_i, type: value[1].to_s, } end |