
Since upgrade is responsibility of USM the upgrade scripts need to be moved to this repo. This commit adds the upgrade-scripts from config, note that the upgrade-scripts will still be located under /usr/local/share/upgrade.d folder. There's also a change in upgrade-scripts to use the log function from this repo instead of controllerconfig one. Also fix a log error in deploy scripts. Test Plan: PASS: Build-pkgs && build-image. PASS: Upgrade from 24.09 to 25.09 in sx. PASS: Install/bootstrap 25.09 in sx. PASS: Check if /usr/local/share/upgrade.d have the same scripts. PASS: Check scripts are logging accordingly. Story: 2011357 Task: 52196 Change-Id: Iab5e6d6f0348f996daf0adb2447d22c4216e537f Signed-off-by: Luis Eduardo Bonatti <luizeduardo.bonatti@windriver.com>
49 lines
1.3 KiB
Bash
49 lines
1.3 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Copyright (c) 2025 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
# This script disables NFV-VIM Web Server. From version 25.x onwards,
|
|
# the web server will stay disabled by default in order to optimize
|
|
# memory and CPU consumption of the host.
|
|
#
|
|
# The user can manually reactivate it issuing the command:
|
|
# "sm-provision service-group-member vim-services vim-webserver"
|
|
#
|
|
|
|
# shellcheck disable=SC2206
|
|
|
|
# The script receives these parameters:
|
|
FROM_RELEASE=$1
|
|
TO_RELEASE=$2
|
|
ACTION=$3
|
|
|
|
SOFTWARE_LOG_PATH="/var/log/software.log"
|
|
FROM_RELEASE_ARR=(${FROM_RELEASE//./ })
|
|
FROM_RELEASE_MAJOR=${FROM_RELEASE_ARR[0]}
|
|
TO_RELEASE_ARR=(${TO_RELEASE//./ })
|
|
TO_RELEASE_MAJOR=${TO_RELEASE_ARR[0]}
|
|
|
|
# Default logging method extracted from script #02
|
|
function log {
|
|
echo "$(date -Iseconds | cut -d'+' -f1): ${NAME}[$$]: INFO: $*" \
|
|
>> "${SOFTWARE_LOG_PATH}" 2>&1
|
|
}
|
|
|
|
if [[ "${ACTION}" == "migrate" ]] && \
|
|
[ ${FROM_RELEASE_MAJOR} -lt 25 ] && \
|
|
[ ${TO_RELEASE_MAJOR} -ge 25 ]; then
|
|
|
|
log Disabling the NFV-VIM Web Server...
|
|
|
|
sm-deprovision service-group-member vim-services vim-webserver
|
|
ret_value=$?
|
|
|
|
[ $ret_value -eq 0 ] && log NFV-VIM Web Server successfully disabled
|
|
exit $ret_value
|
|
|
|
else
|
|
log No actions required from $FROM_RELEASE to $TO_RELEASE with action $ACTION
|
|
fi
|