Class: OsCtld::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/osctld/config.rb

Overview

osctld config file interface

Defined Under Namespace

Classes: CpuPackage, CpuScheduler, Mbuffer, SendReceive, TrashBin

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Config

Returns a new instance of Config.

Parameters:

  • path (String)


144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/osctld/config.rb', line 144

def initialize(path)
  cfg = JSON.parse(File.read(path))

  @debug = cfg.fetch('debug', false)
  @apparmor_paths = cfg.fetch('apparmor_paths', [])
  @enable_time_namespace = cfg.fetch('enable_time_namespace', true)
  @ctstartmenu = cfg['ctstartmenu']
  @enable_lock_registry = cfg.fetch('lock_registry', false)
  @cpu_scheduler = CpuScheduler.new(cfg.fetch('cpu_scheduler', {}))
  @send_receive = SendReceive.new(cfg.fetch('send_receive', {}))
  @trash_bin = TrashBin.new(cfg.fetch('trash_bin', {}))
end

Instance Attribute Details

#apparmor_pathsArray<String> (readonly)

Returns:

  • (Array<String>)


121
122
123
# File 'lib/osctld/config.rb', line 121

def apparmor_paths
  @apparmor_paths
end

#cpu_schedulerCpuScheduler (readonly)

Returns:



135
136
137
# File 'lib/osctld/config.rb', line 135

def cpu_scheduler
  @cpu_scheduler
end

#ctstartmenuString (readonly)

Returns:

  • (String)


128
129
130
# File 'lib/osctld/config.rb', line 128

def ctstartmenu
  @ctstartmenu
end

#debugBoolean (readonly) Also known as: debug?

Enable extra debug logs

Returns:

  • (Boolean)


117
118
119
# File 'lib/osctld/config.rb', line 117

def debug
  @debug
end

#enable_lock_registryBoolean (readonly) Also known as: enable_lock_registry?

Returns:

  • (Boolean)


131
132
133
# File 'lib/osctld/config.rb', line 131

def enable_lock_registry
  @enable_lock_registry
end

#enable_time_namespaceBoolean (readonly) Also known as: enable_time_namespace?

Returns:

  • (Boolean)


124
125
126
# File 'lib/osctld/config.rb', line 124

def enable_time_namespace
  @enable_time_namespace
end

#send_receiveSendReceive (readonly)

Returns:



138
139
140
# File 'lib/osctld/config.rb', line 138

def send_receive
  @send_receive
end

#trash_binTrashBin (readonly)

Returns:



141
142
143
# File 'lib/osctld/config.rb', line 141

def trash_bin
  @trash_bin
end