Add Release Notes Doc Framework
[bottlenecks.git] / common.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 mkdir -p /home/opnfv/bottlenecks/config
12 config_file=/home/opnfv/bottlenecks/config/bottlenecks_cfg.yaml
13
14 if [ ! -f ${config_file} ]; then
15     default_config_file=$(find /home/opnfv -name bottlenecks_cfg.yaml)
16     cp $default_config_file $config_file
17     echo "bottlenecks_cfg.yaml not provided. Using default one"
18 fi
19
20 SUITE_PREFIX_CONFIG=$(cat $config_file | grep -w suite_prefix_config | awk 'END {print $NF}')
21
22 info () {
23     logger -s -t "bottlenecks.info" "$*"
24 }
25
26 error () {
27     logger -s -t "bottlenecks.error" "$*"
28     exit 1
29 }