Method: Inspec::Resources::LinuxFileSystemResource#info
- Defined in:
- lib/inspec/resources/filesystem.rb
#info(partition) ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/inspec/resources/filesystem.rb', line 97 def info(partition) cmd = inspec.command("df #{partition} -T") 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 |