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

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

Constant Summary collapse

VERSIONS =
%w(2 3 4 4.0 4.1 4.2)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cfg) ⇒ Nfsd

Returns a new instance of Nfsd.



29
30
31
32
33
34
35
36
# File 'lib/osctl/exportfs/config/nfsd.rb', line 29

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

Parameters:

  • nproc (Integer)

Returns:

  • (Integer)


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

def nproc
  @nproc
end

#portInteger?

Parameters:

  • port (Integer)

Returns:

  • (Integer, nil)


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

def port
  @port
end

#syslogBoolean

Parameters:

  • syslog (Boolean)

Returns:

  • (Boolean)


27
28
29
# File 'lib/osctl/exportfs/config/nfsd.rb', line 27

def syslog
  @syslog
end

#tcpBoolean

Parameters:

  • tcp (Boolean)

Returns:

  • (Boolean)


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

def tcp
  @tcp
end

#udpBoolean

Parameters:

  • udp (Boolean)

Returns:

  • (Boolean)


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

def udp
  @udp
end

#versionsArray<String>

Parameters:

  • versions (Array<String>)

Returns:

  • (Array<String>)


23
24
25
# File 'lib/osctl/exportfs/config/nfsd.rb', line 23

def versions
  @versions
end

Instance Method Details

#allowed_versionsArray<String>

Returns:

  • (Array<String>)


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

def allowed_versions
  versions
end

#disallowed_versionsArray<String>

Returns:

  • (Array<String>)


55
56
57
# File 'lib/osctl/exportfs/config/nfsd.rb', line 55

def disallowed_versions
  VERSIONS - allowed_versions
end

#dumpObject



38
39
40
41
42
43
44
45
46
47
# File 'lib/osctl/exportfs/config/nfsd.rb', line 38

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