Class: Inspec::Resources::HpuxPkg

Inherits:
PkgManagement show all
Defined in:
lib/resources/package.rb

Instance Attribute Summary

Attributes inherited from PkgManagement

#inspec

Instance Method Summary collapse

Methods inherited from PkgManagement

#initialize

Constructor Details

This class inherits a constructor from Inspec::Resources::PkgManagement

Instance Method Details

#info(package_name) ⇒ Object



178
179
180
181
182
183
184
185
186
187
188
# File 'lib/resources/package.rb', line 178

def info(package_name)
  cmd = inspec.command("swlist -l product | grep #{package_name}")
  return nil if cmd.exit_status.to_i != 0
  pkg = cmd.stdout.strip.split(' ')
  {
    name: pkg[0],
    installed: true,
    version: pkg[1],
    type: 'pkg',
  }
end