summaryrefslogtreecommitdiffstats
path: root/controller/parse_credsfile
blob: df2a6bfcd9a91d8261dc853b9485c9c3ba886aad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
credsfile="private/os/$1.yml"

while read line; do
    if [[ "$line" =~ ^([a-zA-Z0-9_]*):\ ?(.*)$ ]]; then
        key="${BASH_REMATCH[1]}"
        if test "$key" = os_nova_password; then
            key=os_password
        fi
        eval set ${BASH_REMATCH[2]}
        eval export "${key^^}"="\"$@\""
    fi
done < "$credsfile"

# vi: syntax=sh