-
Notifications
You must be signed in to change notification settings - Fork 819
[db_migrator] Migrate DNS configuratuion #2893
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
Changes from 6 commits
2d0c05c
4766a0f
cde9a7f
c2037ed
e360be5
188ed6d
21b4895
8498f1a
d95e543
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ def __init__(self, namespace, socket=None): | |
| none-zero values. | ||
| build: sequentially increase within a minor version domain. | ||
| """ | ||
| self.CURRENT_VERSION = 'version_4_0_3' | ||
| self.CURRENT_VERSION = 'version_4_0_4' | ||
|
|
||
| self.TABLE_NAME = 'VERSIONS' | ||
| self.TABLE_KEY = 'DATABASE' | ||
|
|
@@ -636,6 +636,18 @@ def migrate_route_table(self): | |
| if 'protocol' not in route_attr: | ||
| self.appDB.set(self.appDB.APPL_DB, route_key, 'protocol', '') | ||
|
|
||
| def migrate_dns_nameserver(self): | ||
| """ | ||
| Handle DNS_NAMESERVER table migration. Migrations handled: | ||
| If there's no DNS_NAMESERVER in config_DB, load DNS_NAMESERVER from minigraph | ||
| """ | ||
| if not self.minigraph_data or 'DNS_NAMESERVER' not in self.minigraph_data: | ||
| return | ||
| dns_table = self.configDB.get_table('DNS_NAMESERVER') | ||
| if not dns_table: | ||
| for addr, config in self.minigraph_data['DNS_NAMESERVER'].items(): | ||
| self.configDB.set_entry('DNS_NAMESERVER', addr, config) | ||
|
|
||
| def update_edgezone_aggregator_config(self): | ||
| """ | ||
| Update cable length configuration in ConfigDB for T0 neighbor interfaces | ||
|
|
@@ -1004,9 +1016,19 @@ def version_4_0_2(self): | |
| def version_4_0_3(self): | ||
| """ | ||
| Version 4_0_3. | ||
| This is the latest version for master branch | ||
| """ | ||
| log.log_info('Handling version_4_0_3') | ||
| self.set_version('version_4_0_4') | ||
| return 'version_4_0_4' | ||
|
|
||
| def version_4_0_4(self): | ||
| """ | ||
| Version 4_0_4. | ||
| This is the latest version for master branch | ||
| """ | ||
| log.log_info('Handling version_4_0_4') | ||
| # Updating DNS nameserver | ||
| self.migrate_dns_nameserver() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You updated the existing version, but did not create a new version. Please add new version handler here as a placeholder. Also, when you do that please also update the self.CURRENT_VERSION to the new version.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||
| return None | ||
|
|
||
| def get_version(self): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "DNS_NAMESERVER|1.1.1.1": { | ||
| "state": "enabled" | ||
| }, | ||
| "DNS_NAMESERVER|2001:1001:110:1001::1": { | ||
| "state": "enabled" | ||
| }, | ||
| "VERSIONS|DATABASE": { | ||
| "VERSION": "version_4_0_4" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "VERSIONS|DATABASE": { | ||
| "VERSION": "version_4_0_3" | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.