Revision a6620629 src/vnm_mad/remotes/lib/vlan.rb

View differences:

src/vnm_mad/remotes/lib/vlan.rb
127 127

  
128 128
            OpenNebula.exec_and_log("#{command(:brctl)} addbr #{@nic[:bridge]}")
129 129

  
130
            set_bridge_options
131

  
130 132
            @bridges[@nic[:bridge]] = Array.new
131 133

  
132 134
            OpenNebula.exec_and_log("#{command(:ip)} link set #{@nic[:bridge]} up")
133 135
        end
134 136

  
137
        # Calls brctl to set options stored in bridge_conf
138
        def set_bridge_options
139
            @nic[:bridge_conf].each do |option, value|
140
                case value
141
                when true
142
                    value = "on"
143
                when false
144
                    value = "off"
145
                end
146

  
147
                cmd = "#{command(:brctl)} #{option} " <<
148
                        "#{@nic[:bridge]} #{value}"
149

  
150
                OpenNebula.exec_and_log(cmd)
151
            end
152
        end
153

  
135 154
        # Get hypervisor bridges
136 155
        #   @return [Hash<String>] with the bridge names
137 156
        def get_bridges

Also available in: Unified diff