Class: Phut::Parser
- Inherits:
-
Object
- Object
- Phut::Parser
- Defined in:
- lib/phut/parser.rb
Overview
Configuration DSL parser.
Instance Method Summary collapse
-
#initialize(file) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(file) ⇒ Parser
Returns a new instance of Parser.
11 12 13 14 |
# File 'lib/phut/parser.rb', line 11 def initialize(file) @file = file @netns = [] end |
Instance Method Details
#parse ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/phut/parser.rb', line 16 def parse Syntax.new(@netns).instance_eval IO.read(@file), @file Link.all.each do |link| Vswitch.all.each do |vswitch| device = link.device(vswitch.name) vswitch.add_port device if device end end Vhost.all.each(&:set_default_arp_table) Vhost.connect_link update_netns_interfaces end |