Class: OsCtl::ExportFS::Config::Nfsd

Inherits:
Object
  • Object
show all
Defined in:
lib/osctl/exportfs/config/nfsd.rb

Constant Summary collapse

VERSIONS =
%w[3 4 4.0 4.1 4.2].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cfg) ⇒ Nfsd

Returns a new instance of Nfsd.



23
24
25
26
27
28
29
30
# File 'lib/osctl/exportfs/config/nfsd.rb', line 23

def initialize(cfg)
  @port = cfg['port']
  @nproc = cfg['nproc'] || 8
  @tcp = cfg['tcp'].nil? ? true : cfg['tcp']
  @udp = cfg['udp'].nil? ? false : cfg['udp']
  @versions = cfg['versions'] || ['3']
  @syslog = cfg['syslog'].nil? ? false : cfg['syslog']
end

Instance Attribute Details

#nprocInteger

Returns:

  • (Integer)


9
10
11
# File 'lib/osctl/exportfs/config/nfsd.rb', line 9

def nproc
  @nproc
end

#portInteger?

Returns:

  • (Integer, nil)


6
7
8
# File 'lib/osctl/exportfs/config/nfsd.rb', line 6

def port
  @port
end

#syslogBoolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/osctl/exportfs/config/nfsd.rb', line 21

def syslog
  @syslog
end

#tcpBoolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/osctl/exportfs/config/nfsd.rb', line 12

def tcp
  @tcp
end

#udpBoolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/osctl/exportfs/config/nfsd.rb', line 15

def udp
  @udp
end

#versionsArray<String>

Returns:

  • (Array<String>)


18
19
20
# File 'lib/osctl/exportfs/config/nfsd.rb', line 18

def versions
  @versions
end

Instance Method Details

#allowed_versionsArray<String>

Returns:

  • (Array<String>)


44
45
46
# File 'lib/osctl/exportfs/config/nfsd.rb', line 44

def allowed_versions
  versions
end

#disallowed_versionsArray<String>

Returns:

  • (Array<String>)


49
50
51
# File 'lib/osctl/exportfs/config/nfsd.rb', line 49

def disallowed_versions
  VERSIONS - allowed_versions
end

#dumpObject



32
33
34
35
36
37
38
39
40
41
# File 'lib/osctl/exportfs/config/nfsd.rb', line 32

def dump
  {
    'port' => port,
    'nproc' => nproc,
    'tcp' => tcp,
    'udp' => udp,
    'versions' => versions,
    'syslog' => syslog
  }
end