This repository was archived by the owner on Mar 31, 2023. It is now read-only.
Open
Conversation
…r dhcp operation type CREATE/UPDATE
er1cthe0ne
reviewed
Mar 27, 2021
| } | ||
|
|
||
| switch (current_DhcpState.operation_type()) { | ||
| alcor::schema::OperationType current_operation_type = |
Contributor
There was a problem hiding this comment.
since this is a temporary fix :), it will be great to add a bunch of comment on why we are doing it, what does it do and when we should remove it.
Contributor
Author
There was a problem hiding this comment.
Comment added, thanks for your suggestions 👍
er1cthe0ne
reviewed
Mar 27, 2021
src/dhcp/aca_dhcp_state_handler.cpp
Outdated
| for (int i = 0; i < parsed_struct.port_states().size(); i++) { | ||
| ACA_LOG_INFO( | ||
| "Port %d MAC: %s, device_ID: %s, device_owner: %s\n", i, | ||
| (parsed_struct.port_states().at(i).configuration().mac_address()).c_str(), |
Contributor
There was a problem hiding this comment.
you can do parsed_struct.port_states(i) instead of parsed_struct.port_states().at(i)
er1cthe0ne
reviewed
Mar 27, 2021
src/dhcp/aca_dhcp_state_handler.cpp
Outdated
| alcor::schema::OperationType current_operation_type = | ||
| current_DhcpState.operation_type(); | ||
| if (current_operation_type == alcor::schema::OperationType::UPDATE) { | ||
| for (auto &port_state : parsed_struct.port_states()) { |
Contributor
There was a problem hiding this comment.
for the goalstatev2, you may direct access the corresponding port_state assuming the port resource ID is the same as the DHCP resource ID. See this for an example:
Contributor
Author
There was a problem hiding this comment.
This is really a good way to do it, thanks for pointing it out 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a temporary DHCP fix, we need to test it with the cluster.