I think there is a functional bug here. You are storing a value of CLUSTER_UUID in /etc/maas/maas_local_celeryconfig_cluster.py (line 86) formated like:
CLUSTER_UUID = '<value>'
However, reading that value will fail because you have a inconsistency between the regex given to sed and grep. Instead of outputing <value>, extract_cluster_uuid will output
CLUSTER_UUID = '<value>'
The easiest solution I think is to just ditch the use of grep entirely and use 'sed -n'.
extract_cfg_value() {
# extract the value for a variable named $1 from a
# simplistic formatted shell or python file ($2)
sed -n -e "s/^$1 *= *[\"']\{0,1\}\([^\"']*\).*/\1/p" "$2"
}
extract_cluster_uuid() { extract_cfg_value CLUSTER_UUID "$1"; }
I think there is a functional bug here. You are storing a value of CLUSTER_UUID in /etc/maas/ maas_local_ celeryconfig_ cluster. py (line 86) formated like:
CLUSTER_UUID = '<value>'
However, reading that value will fail because you have a inconsistency between the regex given to sed and grep. Instead of outputing <value>, extract_ cluster_ uuid will output
CLUSTER_UUID = '<value>'
The easiest solution I think is to just ditch the use of grep entirely and use 'sed -n'.
extract_cfg_value() { {0,1\}\ ([^\"'] *\).*/\ 1/p" "$2" cluster_ uuid() { extract_cfg_value CLUSTER_UUID "$1"; }
# extract the value for a variable named $1 from a
# simplistic formatted shell or python file ($2)
sed -n -e "s/^$1 *= *[\"']\
}
extract_