summaryrefslogtreecommitdiffstats
path: root/controller/parse_credsfile
diff options
context:
space:
mode:
Diffstat (limited to 'controller/parse_credsfile')
-rw-r--r--controller/parse_credsfile14
1 files changed, 14 insertions, 0 deletions
diff --git a/controller/parse_credsfile b/controller/parse_credsfile
new file mode 100644
index 0000000..df2a6bf
--- /dev/null
+++ b/controller/parse_credsfile
@@ -0,0 +1,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