arista-eosplus / rbeapi

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

Wildcard connection config gets clobbered #86

Closed charlescng closed 8 years ago

charlescng commented 8 years ago

Given the following configuration:

[connection:*]
username: foo
password: bar

Given the following code:

client = Rbeapi::Client.connect_to('host1')
client = Rbeapi::Client.connect_to('host2')

The config['host'] of value * is clobbered to host1: https://github.com/arista-eosplus/rbeapi/blob/develop/lib/rbeapi/client.rb#L104

The second call to connect_to('host2') has a config['host'] value of host1

It should probably .dup the configuration before modifying config['host'].

devrobo commented 8 years ago

Thank you for reporting this bug, we will get it fixed.