Commit 51ee6452 authored by Christopher Huhn's avatar Christopher Huhn
Browse files

Make dpkg Ohai plugin collect package info beneath node['packages'] and drop...

Make dpkg Ohai plugin collect package info beneath node['packages'] and drop node['debian']['packages'] to avoid information duplication
parent 9d21ca1a
......@@ -2,6 +2,14 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [1.67.0] - 2022-06-08
### Changed
- Ohai plugin [`dpkg.rb`](files/default/ohai_plugins/dpkg.rb) now extends `node['packages']`
### Removed
- Package information is no longer collected beneath `node['debian']['packages']`
## [1.66.1] - 2022-05-18
### Added
......
......@@ -34,7 +34,7 @@ Ohai.plugin(:Dpkg) do
depends 'platform_version'
# Which attribute name space will this plugin take care of?
provides 'debian'
provides 'debian', 'packages'
# read a list of installed packages:
# dpkg-query can be told to produce arbitrary output
......@@ -72,8 +72,11 @@ Ohai.plugin(:Dpkg) do
end
debian Mash.new
packages Mash.new
debian['packages'] = package_data
package_data.each do |name, info|
packages[name] = info
end
# figure out the debian architecture
# (differs from node['kernel']['machine']!)
......
......@@ -16,4 +16,4 @@ supports 'debian'
depends 'line', '< 1.0'
depends 'chef-vault'
version '1.66.1'
version '1.67.0'
......@@ -52,25 +52,36 @@ describe "plugins" do
end
end
describe 'debian' do
describe 'packages' do
subject do
@ohai.require_plugin('debian')
@ohai.data['debian']
@ohai.data['packages']
end
it { should be_a(Mash) }
it do
# the base-files package should always be installed:
should include(packages: a_hash_including(
'base-files' => {
version: anything,
status: 'install ok installed',
arch: 'amd64',
src_pkg: 'base-files'
}
))
should include(
'base-files' => {
version: anything,
status: 'install ok installed',
arch: 'amd64',
src_pkg: 'base-files'
}
)
end
end
describe 'debian' do
subject do
@ohai.require_plugin('debian')
@ohai.data['debian']
end
it { should be_a(Mash) }
it { should include(architecture: 'amd64') }
end
describe 'ssh fingerprints' do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment