Commit d511f44
authored
TPT 1880: Fixed issue with updating non-populated NodeBalancerNode (#277)
## 📝 Description
Previously, attempting to update a non-populated NodeBalancerNode would
result in the update actually updating the resource silently. This
change fixes the issue.
## ✔️ How to Test
`pytest test`
Note: Since this change deals with making updates to real resources as
opposed to fixtures, it cannot be tested using mocks and must therefore
be tested manually. To do this, first create a NodeBalancerNode in your
Linode account if one does not already exist, and then run this python
script and verify that the weight of the node was actually updated.
```
#!/usr/bin/env python3
from linode_api4 import LinodeClient
from linode_api4.objects import NodeBalancerNode
client = LinodeClient(<personal_access_token>)
node = NodeBalancerNode(client, <node_id>, <config_id>, <nodebalancer_id>)
node.weight = 60
node.save()
```
Resolves #971 parent 233a899 commit d511f44
1 file changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
215 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
216 | 233 | | |
217 | 234 | | |
218 | 235 | | |
| |||
0 commit comments