-
-
Notifications
You must be signed in to change notification settings - Fork 739
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
Some cleanup for the db migration script #956
Merged
Merged
Conversation
This file contains 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
* This commit should not change behavior, and only removes trailing whitespace.
Per pep-8 methods within a class should only have a single space between them. Spacing before this commit was inconsistent, with a mix of single and double spaces.
No symbols are currently used from mongo, only pymongo, and the mongo package appears to be unmaintained. https://pypi.org/project/mongo/ points to https://github.com/imbolc/mongo, which shows no contributions since 2012.
This commit does not intend to change behavior, but breaks the schema updater script into a function to better support testing and code decomposition.
Keeping the migration isolated allows for more easily testing the migration logic for each subscriber.
In-place modification makes the code path for the schema update more difficult to understand. This commit changes the way the update is done to be formatted as a translation from old to new.
This commit improves the creation of new slice sessions from existing pdn configurations by supporting additional fields (smf and ue), and throwing an explicit error before writing breaking changes to the DB when it encounters unsupported elements.
If the migration encounters an exception, allow the migration to abort to prevent updating the database with a corrupted value.
Without an explicit unset operator in the query, mongo will leave the existing PDN entry alone.
Thank you so much! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request does some cleanup of the initial rough database migration script added by @nickvsnetworking . It also adds a basic test, although I was not sure how to incorporate python unit testing with the existing meson test infrastructure. I tried to keep the commits individually small, so it might be easier to review on a commit by commit basis rather than as a whole PR. I have tested this in my local virtual environment to make sure the daemons don't crash immediately, but have not tested it with an attached RAN.