Projet

Général

Profil

Révision 032387dc

ID032387dc692902dc82dcd8a4743fb93a902ae82f
Parent 7a77d75a
Enfant 4d95ea85

Ajouté par Steve Traylen il y a environ 4 ans

Add nftables.version to structured fact.

```
FACTERLIB=. facter -p nftables {
tables => [
"bridge-filter",
"bridge-nat",
"inet-firewalld",
"ip-firewalld",
"ip6-firewalld"
],
version => "0.9.3"
}
```

Voir les différences:

lib/facter/nftables.rb
6 6
# table ip6 nat
7 7
# table inet f2b-table
8 8
#
9
# Produce the version of nftables (nft --version)
10
# nftables v0.9.3 (Topsy)
11
#
9 12
Facter.add(:nftables) do
10 13
  @nft_cmd = Facter::Util::Resolution.which('nft')
11 14
  confine { @nft_cmd }
......
16 19
    table_result.each_line do |line|
17 20
      tables.push(line.split(' ')[1, 2].join('-'))
18 21
    end
19
    { 'tables' => tables }
22
    version = Facter::Core::Execution.execute(%(#{@nft_cmd} --version))[%r{^.*v(\d+\.\d+.\d+)\s.*$}, 1]
23
    {
24
      'tables'  => tables,
25
      'version' => version,
26
    }
20 27
  end
21 28
end

Formats disponibles : Unified diff