utilities/tools/engtools/hostdata-collectors/patch-engtools.sh
Long Li 9ec7cf4447 Update engtools to use python3
Change spec and scripts to only use
python3 explicitly

Verification:
1. Regard as the README,in development docker environment, run
./patch-engtools.sh,
it will generate the ENGTOOLS-20.01.patch
if we scp the patch to controller,
we could sw-patch upload and sw-apply it successfully.

2. The engtools-1.0-4.tis.noarch.rpm is not built into bootimage by default
thus if we package it into bootimage when to verify it.
1). Run some bash script, such as
ceph.sh, memstats.sh, netstats.sh and so on
it will display the collect system resource information.
2). The service of collect-engtools.service
could start and stop without problem
3). If we run the modified python which we have changed to python3.
python3 buddyinfo.py
it will deplay the resource information
python3 live_stream.py
the log of livestream.log will display collect information

This package only be packaged into bootimage when we need it to
collect system resource information.

Change-Id: I9bd77e34650e200f0c65db966635a8ebcdc584aa
Story: 2007106
Task: 39112
Depends-on: https://review.opendev.org/#/c/712218/
Depends-on: https://review.opendev.org/#/c/714072/
Signed-off-by: Long Li <lilong-neu@neusoft.com>
2020-04-07 08:04:59 +00:00

34 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Designer patches:
# http://twiki.wrs.com/PBUeng/Patching
if [ -z $MY_WORKSPACE ] || [ -z $MY_REPO ]; then
echo "Some dev environment variables are not set."
echo "Refer to http://wiki.wrs.com/PBUeng/CentOSBuildProcess for instructions."
exit 1
fi
ENGTOOLS=$(ls ${MY_WORKSPACE}/std/rpmbuild/RPMS/engtools*noarch.rpm 2>/dev/null)
if [ $? -ne 0 ]; then
echo "Engtools RPM has not been built. Please run \"build-pkgs engtools\" first."
exit 1
fi
source ${MY_REPO}/stx/utilities/utilities/build-info/release-info.inc
#TiS_REL="16.10"
#PATCH_ID="ENGTOOLS-${TiS_REL}"
PATCH_ID="ENGTOOLS-${PLATFORM_RELEASE}"
PWD=$(pwd)
# Create CGCS Patch
cd ${MY_WORKSPACE}
PATCH_BUILD=${MY_REPO}/stx/update/extras/scripts/patch_build.sh
${PATCH_BUILD} --id ${PATCH_ID} --reboot-required=N \
--summary "System engineering data collection and analysis tools." \
--desc "System engineering data collection and analysis tools." \
--all-nodes ${ENGTOOLS} \
--warn "Intended for system engineering use only."
cd ${PWD}
exit 0