Skip to content

Commit

Permalink
SM-INSTALL: restart server-manager on upgrade case
Browse files Browse the repository at this point in the history
Closes-Bug: #1555601

CHANGES:
1. restart contrail-server-manager for upgrade case.
2. added "x" while checking for status of contrail-webui.

Testing:
1. upgraded 2718 to 2720 and verified server-manager was restarted and its
output was logged into log file.
2. no error was reported about syntax  (supervisor-webui service not
available).

PATCH2:
updated code to resolve review comments.

PATCH3:
rectified the indentation of the code.

PATCH4:
Addressed review comments

Change-Id: I2503963d6ec769920a3ede17be77cf03913e5795
  • Loading branch information
Dheeraj Gautam committed Mar 23, 2016
1 parent 0774afb commit 9295299
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions build/deb_server_manager_setup.sh
Expand Up @@ -216,6 +216,7 @@ done
cleanup_smgr_repos
setup_smgr_repos

RESTART_SERVER_MANAGER=""
if [ "$SM" != "" ]; then
echo "$arrow Server Manager"

Expand Down Expand Up @@ -273,14 +274,11 @@ if [ "$SM" != "" ]; then
if [ "$check_upgrade" != "" ]; then
# Upgrade
echo "$space$arrow Upgrading Server Manager"
RESTART_SERVER_MANAGER="1"
if [ "$SMLITE" != "" ]; then
echo "$space$arrow$install_str Server Manager Lite"
apt-get -y install contrail-server-manager-lite >> $log_file 2>&1
apt-get -y install -f >> $log_file 2>&1
echo "$space$space$arrow Starting Server Manager Lite Service"
service contrail-server-manager restart
sleep 5
service contrail-server-manager status
else
cv=`cobbler --version`
cv=( $cv )
Expand All @@ -296,19 +294,18 @@ if [ "$SM" != "" ]; then
apt-get -y install contrail-server-manager >> $log_file 2>&1
apt-get -y install -f >> $log_file 2>&1
# Stopping webui service that uses old name
old_webui_status=`service supervisor-webui status | awk '{print $2}' | cut -d'/' -f 1`
if [ $old_webui_status != "stop" ]; then
service supervisor-webui stop >> $log_file 2>&1 # TODO : Remove for 3.0 release
if [ -f /etc/init.d/supervisor-webui ]; then
old_webui_status=`service supervisor-webui status | awk '{print $2}' | cut -d'/' -f 1`
if [ $old_webui_status != "stop" ]; then
service supervisor-webui stop >> $log_file 2>&1 # TODO : Remove for 3.0 release
fi
fi
fi
else
if [ "$SMLITE" != "" ]; then
echo "$space$arrow$install_str Server Manager Lite"
apt-get -y install contrail-server-manager-lite >> $log_file 2>&1
echo "$space$space$arrow Starting Server Manager Lite Service"
service contrail-server-manager restart
sleep 5
service contrail-server-manager status
RESTART_SERVER_MANAGER="1"
else
echo "$space$arrow$install_str Server Manager"
apt-get -y install cobbler="2.6.3-1" >> $log_file 2>&1 # TODO : Remove after local repo pinning
Expand Down Expand Up @@ -364,6 +361,16 @@ if [ "$SMMON" != "" ] && [ "$NOSMMON" == "" ]; then
echo "$arrow Completed Installing Server Manager Monitoring"
fi

if [ "x$RESTART_SERVER_MANAGER" == "x1" ]; then
if [ "$SMLITE" != "" ]; then
echo "$space$space$arrow Starting Server Manager Lite Service"
else
echo "$space$space$arrow Starting Server Manager Service"
fi
service contrail-server-manager restart >> $log_file 2>&1
sleep 5
fi

# Should we remove Puppet/Passenger sources.list.d files also?
echo "$arrow Reverting Repos to old state"
rm -f /etc/apt/sources.list.d/puppet.list >> $log_file 2>&1
Expand Down

0 comments on commit 9295299

Please sign in to comment.