Ensure vim database directory exists

Ensure /opt/platform/nfv/vim/<ver> directory is created before
creating vim database.

TCs:
1. Full upgrade AIO-DX 22.06 -> 22.12 Debian passed

Closes-Bug: 1992828

Signed-off-by: Bin Qian <bin.qian@windriver.com>
Change-Id: I330cd41a4405d9cb99a88aa938a1ac385f0e6f8e
This commit is contained in:
Bin Qian
2022-10-13 16:12:14 +00:00
parent f3a9f01794
commit 88b4942d39

View File

@@ -534,8 +534,9 @@ def import_databases(from_release, to_release, from_path=None, simplex=False):
# a safe solution.
VIM_DB_NAME = 'vim_db_v1'
temp_db_path = '/tmp/'
db_path = os.path.join(PLATFORM_PATH, 'nfv/vim',
SW_VERSION, VIM_DB_NAME)
db_dir = os.path.join(PLATFORM_PATH, 'nfv/vim', SW_VERSION)
os.mkdir(db_dir)
db_path = os.path.join(db_dir, VIM_DB_NAME)
import_commands.append(
("nfv-vim",
"nfv-vim-manage db-load-data -d %s -f %s" %