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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Node Network Attach Functionality Into esisdk #8

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

ajamias
Copy link
Collaborator

@ajamias ajamias commented Jul 19, 2024

Originally, this functionality existed in python-esiclient. It is being moved into esisdk so both python-esiclient and esi-ui can use it.

esi/lib/nodes.py Outdated
@@ -138,3 +140,86 @@ def network_list(connection, filter_node=None, filter_network=None):
})

return data


def network_attach(connection, node, filter_network=None, filter_port=None, filter_trunk=None, mac_address=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest changing these arguments. They aren't really filters; they're the actual networks/ports you want to use. In fact, it may feel cleaner to have something like:

def network_attach(connection, node, network_dict)

And then essentially have the same logic below, except checking the keys of the dict for network/port/trunk/mac_address.

@ajamias ajamias force-pushed the main branch 4 times, most recently from f8387f6 to 0699156 Compare July 19, 2024 20:23
esi/lib/nodes.py Outdated Show resolved Hide resolved
esi/lib/nodes.py Outdated Show resolved Hide resolved
Originally, this functionality existed in python-esiclient.
It is being moved into esisdk so both python-esiclient and
esi-ui can use it.

esi-leap's node resource has added more attributes:
target_provision_state, power_state, and target_power_state.
This change is to add those attributes to esisdk's node resource.
Copy link
Collaborator

@tzumainn tzumainn left a comment

Choose a reason for hiding this comment

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

Looks good!

@tzumainn tzumainn merged commit a4f56e7 into CCI-MOC:main Jul 23, 2024
4 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
2 participants