Class: Construqt::Flavour::Ubuntu::Vlan
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Construqt::Flavour::Ubuntu::Vlan
- Defined in:
- lib/construqt/flavour/ubuntu/flavour_ubuntu.rb
Instance Method Summary collapse
- #build_config(host, iface) ⇒ Object
-
#initialize(cfg) ⇒ Vlan
constructor
A new instance of Vlan.
Constructor Details
#initialize(cfg) ⇒ Vlan
Returns a new instance of Vlan.
113 114 115 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu.rb', line 113 def initialize(cfg) super(cfg) end |
Instance Method Details
#build_config(host, iface) ⇒ Object
117 118 119 120 121 122 123 124 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu.rb', line 117 def build_config(host, iface) vlan = iface.name.split('.') throw "vlan name not valid if.# => #{iface.name}" if vlan.length != 2 || !vlan.first.match(/^[0-9a-zA-Z]+$/) || !vlan.last.match(/^[0-9]+/) || !(1 <= vlan.last.to_i && vlan.last.to_i < 4096) Device.build_config(host, iface) end |