Sha256: efd5273dec9f54851c1e78cabc12890ee0b4fad5a2409fea41b6aa43b85cb14f

Contents?: true

Size: 475 Bytes

Versions: 6

Compression:

Stored size: 475 Bytes

Contents

module Serverspec
  module Type
    class Cgroup < Base
      attr_accessor :subsystem
      def method_missing(meth)
        if @subsystem.nil?
          @subsystem = meth.to_s
          self
        else
          param = "#{@subsystem}.#{meth.to_s}"
          ret = @runner.run_command("cgget -n -r #{param} #{@name} | awk '{print $2}'")
          val = ret.stdout.strip
          val = val.to_i if val.match(/^\d+$/)
          val
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta8 lib/serverspec/type/cgroup.rb
serverspec-2.0.0.beta7 lib/serverspec/type/cgroup.rb
serverspec-2.0.0.beta6 lib/serverspec/type/cgroup.rb
serverspec-2.0.0.beta5 lib/serverspec/type/cgroup.rb
serverspec-2.0.0.beta4 lib/serverspec/type/cgroup.rb
serverspec-2.0.0.beta3 lib/serverspec/type/cgroup.rb