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

Adding provision to clean out alternate config #586

Merged
merged 7 commits into from
Feb 14, 2023

Conversation

grafnu
Copy link
Collaborator

@grafnu grafnu commented Feb 14, 2023

Nukes the not-in-use config to prevent it inadvertently being used to bounce around from a not-used endpoint.

@@ -1242,8 +1240,19 @@ protected void withAlternateClient(Runnable evaluator) {
}
}

protected void mirrorDeviceConfig() {
String receivedConfig = actualize(stringify(receivedUpdates.get(CONFIG_SUBTYPE)));
protected void mirrorToOtherConfig() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we have some line by line comments here? It's getting fairly dense...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

}

protected void clearOtherConfig() {
updateMirrorConfig("{}");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comments please. Should this run in all conditions or are there any useful assertions to add that help document what's going on.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know what assertions to add -- I added one to make sure the client was setup correctly, but if that was the case it would have had a horrible NPE anyway -- it's just a bit more clear.

@grafnu grafnu requested a review from johnrandolph February 14, 2023 17:01
@grafnu
Copy link
Collaborator Author

grafnu commented Feb 14, 2023

Updated with comments.

@grafnu grafnu merged commit b94f6e2 into faucetsdn:master Feb 14, 2023
@grafnu grafnu deleted the nukeconfig branch February 14, 2023 17:31
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