netbox-community / pynetbox

Python API client library for Netbox.
Apache License 2.0
575 stars 171 forks source link

save() on tags attribute not correctly saving after using remove() #118

Closed jord-bh closed 5 years ago

jord-bh commented 5 years ago

After #94 was fixed, I noticed the same behaviour if instead of using append, caling remove() on the tags list. Or is that not supported?



>>> import pynetbox
>>> nb = pynetbox.api(url='https://sub.domain.tld' token='0123456789abcdef0123456789abcdef01234567')
>>> intf = nb.dcim.interfaces.get(name='eth0')
>>> intf.tags
['27']
>>> intf.tags.remove('27')
>>> intf.tags
[]
>>> intf.save()
False
`` 
zachmoody commented 5 years ago

Are you using 3.4.10? The problematic code addressed in #115 would've caused this behavior, but should be fixed. I'm not able to replicate on 3.4.10.

jord-bh commented 5 years ago

Oh, terribly sorry, my bad. Somehow, I'd managed to mess up the virtualenv loaded, you are correct.

zachmoody commented 5 years ago

Great to hear, just glad we can finally close the book on this bug. :smile: