File: oci_cpu_flags.rb

package info (click to toggle)
openstack-cluster-installer 43.0.19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,540 kB
  • sloc: php: 19,150; sh: 18,091; ruby: 75; makefile: 31; xml: 8
file content (12 lines) | stat: -rw-r--r-- 256 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
require 'open3'
Facter.add(:oci_cpu_flags) do
  setcode do
    mytable = []
    cmd = "lscpu | grep Flags | sed s/Flags://"
    output, exit_code = Open3.capture2(cmd)
    output.split.map().each do |val|
      mytable << val
    end
    mytable
  end
end