Dynamic width count for plugin registry table column
There might be chance that few plugin name and url does not fit into hard coded column width and give error. This commit count the column width as per plugins name. Also display the number of plugins in new SR column. Change-Id: Ia5736d2581ee3b6f851b8d08f855c2a19c157c47
This commit is contained in:
parent
82539ad1c1
commit
df037310ba
@ -17,7 +17,3 @@ Detected Plugins
|
|||||||
The following are plugins that a script has found in the openstack/
|
The following are plugins that a script has found in the openstack/
|
||||||
namespace, which includes but is not limited to official OpenStack
|
namespace, which includes but is not limited to official OpenStack
|
||||||
projects.
|
projects.
|
||||||
|
|
||||||
+----------------------------+-------------------------------------------------------------------------+
|
|
||||||
|Plugin Name |URL |
|
|
||||||
+----------------------------+-------------------------------------------------------------------------+
|
|
||||||
|
@ -49,13 +49,37 @@ fi
|
|||||||
|
|
||||||
sorted_plugins=$(python tools/generate-tempest-plugins-list.py)
|
sorted_plugins=$(python tools/generate-tempest-plugins-list.py)
|
||||||
|
|
||||||
|
name_col_len=$(echo "${sorted_plugins}" | wc -L)
|
||||||
|
name_col_len=$(( name_col_len + 2 ))
|
||||||
|
|
||||||
|
# Print the title underline for a RST table.
|
||||||
|
function title_underline {
|
||||||
|
printf "== "
|
||||||
|
local len=$1
|
||||||
|
while [[ $len -gt 0 ]]; do
|
||||||
|
printf "="
|
||||||
|
len=$(( len - 1))
|
||||||
|
done
|
||||||
|
printf " ===\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
printf "\n\n"
|
||||||
|
title_underline ${name_col_len}
|
||||||
|
printf "%-3s %-${name_col_len}s %s\n" "SR" "Plugin Name" "URL"
|
||||||
|
title_underline ${name_col_len}
|
||||||
|
|
||||||
|
i=0
|
||||||
for k in ${sorted_plugins}; do
|
for k in ${sorted_plugins}; do
|
||||||
|
i=$((i+1))
|
||||||
project=${k:0:28}
|
project=${k:0:28}
|
||||||
giturl="git://git.openstack.org/openstack/${k:0:26}"
|
giturl="git://git.openstack.org/openstack/${k:0:26}"
|
||||||
printf "|%-28s|%-73s|\n" "${project}" "${giturl}"
|
printf "%-3s %-${name_col_len}s %s\n" "$i" "${project}" "${giturl}"
|
||||||
printf "+----------------------------+-------------------------------------------------------------------------+\n"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
title_underline ${name_col_len}
|
||||||
|
|
||||||
|
printf "\n\n"
|
||||||
|
|
||||||
if [[ -r doc/source/data/tempest-plugins-registry.footer ]]; then
|
if [[ -r doc/source/data/tempest-plugins-registry.footer ]]; then
|
||||||
cat doc/source/data/tempest-plugins-registry.footer
|
cat doc/source/data/tempest-plugins-registry.footer
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user