Skip to content

Commit

Permalink
Update db-migrator to support fast-reboot finalizer when upgrading fr…
Browse files Browse the repository at this point in the history
…om older versions
  • Loading branch information
arfeigin committed Feb 8, 2023
1 parent e331d3a commit 9d70bb8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions scripts/db_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, namespace, socket=None):
none-zero values.
build: sequentially increase within a minor version domain.
"""
self.CURRENT_VERSION = 'version_4_0_0'
self.CURRENT_VERSION = 'version_4_0_1'

self.TABLE_NAME = 'VERSIONS'
self.TABLE_KEY = 'DATABASE'
Expand Down Expand Up @@ -850,9 +850,21 @@ def version_3_0_6(self):
def version_4_0_0(self):
"""
Version 4_0_0.
This is the latest version for master branch
"""
log.log_info('Handling version_4_0_0')
# Update state-db fast-reboot entry to enable if set to enable fast-reboot finalizer when using upgrade with fast-reboot
fastreboot_state = self.stateDB.get(self.stateDB.STATE_DB, 'FAST_REBOOT|system', '1')
if fastreboot_state == 'true':
self.stateDB.set(self.stateDB.STATE_DB, 'FAST_REBOOT|system', 'enable')
self.set_version('version_4_0_1')
return None

def version_4_0_1(self):
"""
Version 4_0_1.
This is the latest version for master branch
"""
log.log_info('Handling version_4_0_1')
return None

def get_version(self):
Expand Down

0 comments on commit 9d70bb8

Please sign in to comment.