<commit_before>#
# Script to generate ansible host file from undercloud nova-list
#
#
. ~/stackrc
file="./hosts"
compute=()
controllers=()
ceph=()
while read line; do
 host=$(echo $line| awk '{print $4}')
 IP=$(echo $line | awk '{print $12}' | cut -d "=" -f2)
 if [[ ${host} =~ compute ]]; then
   compute+="$IP "
 fi
 if [[ ${host} =~ ceph ]] ; then
   ceph+="$IP "
 fi
 if [[ ${host} =~ control ]]; then
   controllers+="$IP "
 fi
done < <(nova list | grep over)

if [[ ${#compute} -gt 0 ]]; then
echo "[computes]">> $file | tee
for c in ${compute[@]}; do
  echo $c >> $file | tee
done
fi
if [[ ${#controllers} -gt 0 ]]; then
echo "">> $file | tee
echo "[controllers]" >> $file | tee
for ct in ${controllers[@]}; do
 echo $ct >> $file | tee
done
fi
if [[ ${#ceph} -gt 0 ]]; then
echo "" >> $file | tee
echo "[ceph]" >> $file | tee
for ceph in ${ceph[@]}; do
 echo $ceph >> $file | tee
done
fi<commit_msg>removing the useless tee<commit_after>#
# Script to generate ansible host file from undercloud nova-list
#
#
. ~/stackrc
file="./hosts"
compute=()
controllers=()
ceph=()
while read line; do
 host=$(echo $line| awk '{print $4}')
 IP=$(echo $line | awk '{print $12}' | cut -d "=" -f2)
 if [[ ${host} =~ compute ]]; then
   compute+="$IP "
 fi
 if [[ ${host} =~ ceph ]] ; then
   ceph+="$IP "
 fi
 if [[ ${host} =~ control ]]; then
   controllers+="$IP "
 fi
done < <(nova list | grep over)

if [[ ${#compute} -gt 0 ]]; then
echo "[computes]">> $file
for c in ${compute[@]}; do
  echo $c >> $file
done
fi
if [[ ${#controllers} -gt 0 ]]; then
echo "">> $file
echo "[controllers]" >> $file
for ct in ${controllers[@]}; do
 echo $ct >> $file
done
fi
if [[ ${#ceph} -gt 0 ]]; then
echo "" >> $file
echo "[ceph]" >> $file
for ceph in ${ceph[@]}; do
 echo $ceph >> $file
done
fi
{'fraction_non_alphanumeric': 0.2276056338028169, 'fraction_numerical': 0.007887323943661971, 'mean_word_length': 3.6736842105263157, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5250338', 'n_tokens_mistral': 704, 'n_tokens_neox': 676, 'n_words': 236}