Files
openstack-armada-app/upstream/openstack/python-horizon/debian/files/horizon-patching-restart
Lucas de Ataides d197336e5e Fix downloader for Horizon package
On the review that introduce the upstream/openstack folder to this
repo [1], the centos folders for all packages were removed, as they're not
used anymore. This wasn't true for the Horizon package, as it contained
some files on the centos folder that were used on the downloader.

This change reintroduces those files under the debian folder, fixing
their directory on the meta_data.yaml file of this package.

None of the files under /upstream/openstack/python-horizon/debian/files/* were changed, they were only copied from [2]

[1] https://review.opendev.org/c/starlingx/openstack-armada-app/+/886027
[2] https://opendev.org/starlingx/upstream/src/branch/master/openstack/python-horizon/centos/files

Test Plan:
PASS: Run downloader for the Horizon package
PASS: Build Horizon package
PASS: Build stx-horizon image

Story: 2010774
Task: 48115

Change-Id: Ibe92cd40cc5f16f105a6812d9a86cb772e15f2b0
Signed-off-by: Lucas de Ataides <lucas.deataidesbarreto@windriver.com>
2023-06-22 15:20:38 +00:00

81 lines
2.0 KiB
Bash

#!/bin/bash
#
# Copyright (c) 2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
#
# The patching subsystem provides a patch-functions bash source file
# with useful function and variable definitions.
#
. /etc/patching/patch-functions
#
# We can now check to see what type of node we're on, if it's locked, etc,
# and act accordingly
#
#
# Declare an overall script return code
#
declare -i GLOBAL_RC=$PATCH_STATUS_OK
#
# handle restarting horizon.
#
if is_controller
then
# Horizon only runs on the controller
if [ ! -f $PATCH_FLAGDIR/horizon.restarted ]
then
# Check SM to see if Horizon is running
sm-query service horizon | grep -q 'enabled-active'
if [ $? -eq 0 ]
then
loginfo "$0: Logging out all horizon sessions"
# Remove sessions
rm -f /var/tmp/sessionid*
loginfo "$0: Restarting horizon"
# Ask SM to restart Horizon
sm-restart service horizon
touch $PATCH_FLAGDIR/horizon.restarted
# Wait up to 30 seconds for service to recover
let -i UNTIL=$SECONDS+30
while [ $UNTIL -ge $SECONDS ]
do
# Check to see if it's running
sm-query service horizon | grep -q 'enabled-active'
if [ $? -eq 0 ]
then
break
fi
# Still not running? Let's wait 5 seconds and check again
sleep 5
done
sm-query service horizon | grep -q 'enabled-active'
if [ $? -ne 0 ]
then
# Still not running! Clear the flag and mark the RC as failed
loginfo "$0: Failed to restart horizon"
rm -f $PATCH_FLAGDIR/horizon.restarted
GLOBAL_RC=$PATCH_STATUS_FAILED
sm-query service horizon
fi
fi
fi
fi
#
# Exit the script with the overall return code
#
exit $GLOBAL_RC