Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPT 1880: Fixed issue with updating non-populated NodeBalancerNode #277

Merged
merged 4 commits into from
May 9, 2023

Conversation

ezilber-akamai-zz
Copy link
Contributor

馃摑 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 #97

@ezilber-akamai-zz ezilber-akamai-zz requested a review from a team April 28, 2023 16:06
Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Just a few changes

linode_api4/objects/base.py Outdated Show resolved Hide resolved
linode_api4/objects/base.py Outdated Show resolved Hide resolved
linode_api4/objects/base.py Outdated Show resolved Hide resolved
@ezilber-akamai-zz ezilber-akamai-zz requested a review from a team May 4, 2023 13:35
Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@ezilber-akamai-zz ezilber-akamai-zz requested a review from a team May 5, 2023 17:27
@ezilber-akamai-zz ezilber-akamai-zz merged commit d511f44 into linode:dev May 9, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NodebalancerNode not found.
4 participants