From 4b6b34642374103b8ccf938eb9e970232bfb63ae Mon Sep 17 00:00:00 2001 From: "Hansen, Tony (th1395)" Date: Wed, 17 Aug 2022 21:36:24 +0000 Subject: CodeCoverage improvement (60% to 90%) Change-Id: I579e9d3fedbd6cc2589d189b121fa7dadfb6f7f1 Signed-off-by: Hansen, Tony (th1395) Issue-ID: DCAEGEN2-3158 Signed-off-by: Hansen, Tony (th1395) --- snmptrap/snmptrapd.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'snmptrap/snmptrapd.sh') diff --git a/snmptrap/snmptrapd.sh b/snmptrap/snmptrapd.sh index 717f660..6755c0c 100755 --- a/snmptrap/snmptrapd.sh +++ b/snmptrap/snmptrapd.sh @@ -2,7 +2,7 @@ # -*- indent-tabs-mode: nil -*- # vi: set expandtab: # # ============LICENSE_START======================================================= -# Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ fi export PYTHONPATH=${bin_base_dir}/mod:$PYTHONPATH # PYTHONUNBUFFERED: -# set PYTHONUNBUFFERED to a non-empty string to avoid output buffering; +# set PYTHONUNBUFFERED to a non-empty string to avoid output buffering; # comment out for runtime environments/better performance! # export PYTHONUNBUFFERED="True" @@ -77,14 +77,14 @@ export CBS_SIM_JSON=${base_dir}/etc/snmptrapd.json # misc exit_after=1 -# # # # # # # # # # +# # # # # # # # # # # log_msg - log messages to stdout in standard manner -# # # # # # # # # # +# # # # # # # # # # log_msg() { msg=$* - echo "`date +%Y-%m-%dT%H:%M:%S,%N | cut -c1-23` ${msg}" + echo "`date +%Y-%m-%dT%H:%M:%S,%N | cut -c1-23` ${msg}" } # @@ -96,7 +96,7 @@ process_name=$1 pid_file=$2 exec_cmd=$3 - # check if exec_cmd has a pid_file + # check if exec_cmd has a pid_file if [ ! -r ${pid_file} ] then log_msg "Starting ${process_name}" @@ -123,13 +123,13 @@ exec_cmd=$3 fi } -# # # # # # # # # # +# # # # # # # # # # # Start the service -# # # # # # # # # # +# # # # # # # # # # start_service() { # Hints for startup modifications: - # _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + # _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # handy for debug (e.g. docker logs output) # log_msg "Runtime env present for ${current_module} placed in ${base_dir}/logs/${current_module}.out" @@ -165,9 +165,9 @@ start_service() fi } -# # # # # # # # # # +# # # # # # # # # # # Stop the service -# # # # # # # # # # +# # # # # # # # # # stop_process() { process_name=$1 @@ -337,7 +337,7 @@ case "$1" in status_service wait ;; - "stop") + "stop") version stop_service ;; @@ -348,7 +348,7 @@ case "$1" in start_service status_service ;; - "status") + "status") version status_service ;; -- cgit 1.2.3-korg