Make platform.conf variables visible to collect.d service scripts

A number of collect.d service scripts are not gathering
all the info that is needed during the collect operation.

Many collect.d service scripts use nodetype, subfunction,
vswitch_type and other platform.conf variables to determine
what to collect.

However, these variables are seen to be empty causing the
service scripts to make incorrect collection decisions.

This update modifies the scoping of loaded platform.conf
variables so that they are visible to all of collect,
including the collect.d service scripts.

Test Plan:

PASS: Verify platform.conf variables are visible to collect.d service scripts.
PASS: Verify file list before and after update.
PASS: Run collect all and verify missing content present.
PASS: Run collect host and verify missing content present.

Change-Id: Ia6f45afd3f3fc676b0d3eaca16dc8bbe68356c8e
Closes-Bug: 1839389
This commit is contained in:
Eric MacDonald 2019-08-13 11:16:10 -04:00
parent 1f600b3bb5
commit 93c067606a
3 changed files with 19 additions and 7 deletions

View File

@ -1,2 +1,2 @@
SRC_DIR="scripts" SRC_DIR="scripts"
TIS_PATCH_VER=29 TIS_PATCH_VER=30

View File

@ -1,12 +1,27 @@
#! /bin/bash #! /bin/bash
######################################################################## ########################################################################
# #
# Copyright (c) 2016 Wind River Systems, Inc. # Copyright (c) 2016-2019 Wind River Systems, Inc.
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
######################################################################## ########################################################################
# make these platform.conf variables global.
# values are loaded in source_openrc_if_needed.
export nodetype=""
export subfunction=""
export system_type=""
export security_profile=""
export sdn_enabled=""
export region_config=""
export vswitch_type=""
export system_mode=""
export sw_version=""
# assume this is not the active controller until learned
export ACTIVE=false
# #
# Import commands, variables and convenience functions available to # Import commands, variables and convenience functions available to
# all collectors ; common and user defined. # all collectors ; common and user defined.

View File

@ -1,6 +1,6 @@
#! /bin/bash #! /bin/bash
# #
# Copyright (c) 2013-2014 Wind River Systems, Inc. # Copyright (c) 2013-2019 Wind River Systems, Inc.
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@ -70,11 +70,8 @@ function source_openrc_if_needed
exit $FAIL_NODETYPE exit $FAIL_NODETYPE
fi fi
NODETYPE=$nodetype
SUBFUNCTION=$subfunction
ACTIVE=false ACTIVE=false
if [ "$NODETYPE" == "controller" ] ; then if [ "$nodetype" == "controller" ] ; then
# get local host activity state # get local host activity state
OPENRC="/etc/platform/openrc" OPENRC="/etc/platform/openrc"
if [ -e "${OPENRC}" ] ; then if [ -e "${OPENRC}" ] ; then