Class: OsCtl::ExportFS::Operations::Exportfs::Generate
- Includes:
- Lib::Utils::File
- Defined in:
- lib/osctl/exportfs/operations/exportfs/generate.rb
Overview
Generate exports file from the database for use with exportfs
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
protected
Returns the value of attribute server.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(server) ⇒ Generate
constructor
A new instance of Generate.
Methods inherited from Base
Constructor Details
#initialize(server) ⇒ Generate
Returns a new instance of Generate.
9 10 11 |
# File 'lib/osctl/exportfs/operations/exportfs/generate.rb', line 9 def initialize(server) @server = server end |
Instance Attribute Details
#server ⇒ Object (readonly, protected)
Returns the value of attribute server.
24 25 26 |
# File 'lib/osctl/exportfs/operations/exportfs/generate.rb', line 24 def server @server end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/osctl/exportfs/operations/exportfs/generate.rb', line 13 def execute cfg = server.open_config regenerate_file(server.exports_file, 0644) do |new| cfg.exports.each do |ex| new.puts("#{ex.as} #{ex.host}(#{ex.})") end end end |