2 # Utility script used to interact with a deployment
3 # @author Tim Rozet (trozet@redhat.com)
5 CONFIG=${CONFIG:-'/var/opt/opnfv'}
6 VALID_CMDS="undercloud debug-stack -h --help"
8 source $CONFIG/lib/utility-functions.sh
14 local inv=(${list[*]##${given}*})
15 local OIFS=$IFS; IFS='|'; local pat="${inv[*]}"; IFS=$OIFS
17 echo "${list[*]##+($pat)}"
22 echo -e "Usage:\n$0 [arguments] \n"
23 echo -e " undercloud <user> : Connect to Undercloud VM as <user>\n"
24 echo -e " debug-stack : Print parsed deployment failures to stdout \n"
27 ##translates the command line argument
28 ##params: $@ the entire command line is passed
29 ##usage: parse_cmd_line() "$@"
33 match=($(resolve_cmd $1 $VALID_CMDS))
34 if [ ${#match[*]} -gt 1 ]; then
35 echo "$1 is ambiguous, possible matches: ${match[*]}" >&2
37 elif [ ${#match[*]} -lt 1 ]; then
38 echo "$1 is not a recognized command. Use -h to see acceptable list" >&2
41 match=$(echo $match | tr -d ' ')
51 # connect as stack by default
52 undercloud_connect stack
59 undercloud_connect stack "$(typeset -f debug_stack); debug_stack"
63 echo -e "\n\nThis script is used to interact with Apex deployments\n\n"
64 echo "Use -h to display help"