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

device_allocation resource: check if the target is switch or server inUpdate() #590

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

chrismarget-j
Copy link
Collaborator

The EnsureSystemIsSwitchBeforeCreate() function gets called to ensure that the target system is a switch (not generic) before a device_allocation resource with system_attributes is allowed to Create().

That is because servers have different methods for handling ASN and Loopback addressing then switches, and we've only implemented the switch bits.

The problem comes up if a user adds system_attributes after initial create.

We need to do the same check in Update().

This PR renames EnsureSystemIsSwitchBeforeCreate() to EnsureSystemIsSwitch() and modifies its check to use either the NodeName attribute (during initial Create()) or NodeId (during Update()) as appropriate.

@chrismarget-j
Copy link
Collaborator Author

Closes #589

@chrismarget-j chrismarget-j merged commit df1687a into main Feb 24, 2024
1 check passed
@chrismarget-j chrismarget-j deleted the bug/589-server-only-check-in-update branch February 24, 2024 18:18
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.

2 participants