arista-eosplus / rbeapi

Ruby client for Arista eAPI
BSD 3-Clause "New" or "Revised" License
16 stars 16 forks source link

vlans API only returns first trunk_group #113

Closed jerearista closed 8 years ago

jerearista commented 8 years ago
-bash-4.1# FastCli -p 15 -c 'show run sect vlan'
vlan 5
   name myname
   trunk group mlag_ctl
   trunk group test
irb(main):004:0> vlans = node.api('vlans').getall
=> {"1"=>{:name=>"default", :state=>"active", :trunk_groups=>[]}, "5"=>{:name=>"myname", :state=>"active", :trunk_groups=>["mlag_ctl"]}}
irb(main):006:0> vlans['5']
=> {:name=>"jere05", :state=>"active", :trunk_groups=>["mlag_ctl"]}

trunk_groups should be :trunk_groups=>["mlag_ctl", "test"]

devrobo commented 8 years ago

The bug is in parse_trunk_groups: values = config.scan(/trunk group (.+)$/).first

The first at the end of the line should be flatten.

devrobo commented 8 years ago

Failure got through because unit and system tests did not have multiple trunk groups. Puppet system tests should have caught this but I forgot to change the modules being tested with.