These functions commonly externally called (as part of stackrc
inclusion, even) and do a fair bit of iteration over long
service-lists, which really fills up the logs of devstack and grenade
with unnecessary details.
The functions are well tested by unit-tests, so we are very unlikely
to need to debug internal issues with them in a hurry. Thus turn
logging down for them.
Change-Id: I63b9a05a0678c7e0c7012f6d768c29fd67f090d2
| ... | ... |
@@ -1147,7 +1147,7 @@ function update_package_repo {
|
| 1147 | 1147 |
|
| 1148 | 1148 |
if is_ubuntu; then |
| 1149 | 1149 |
local xtrace |
| 1150 |
- xtrace=$(set +o | grep xtrace) |
|
| 1150 |
+ xtrace=$(set +o | grep xtrace) |
|
| 1151 | 1151 |
set +o xtrace |
| 1152 | 1152 |
if [[ "$REPOS_UPDATED" != "True" || "$RETRY_UPDATE" = "True" ]]; then |
| 1153 | 1153 |
# if there are transient errors pulling the updates, that's fine. |
| ... | ... |
@@ -1758,11 +1758,17 @@ function run_phase {
|
| 1758 | 1758 |
# remove extra commas from the input string (i.e. ``ENABLED_SERVICES``) |
| 1759 | 1759 |
# _cleanup_service_list service-list |
| 1760 | 1760 |
function _cleanup_service_list {
|
| 1761 |
+ local xtrace |
|
| 1762 |
+ xtrace=$(set +o | grep xtrace) |
|
| 1763 |
+ set +o xtrace |
|
| 1764 |
+ |
|
| 1761 | 1765 |
echo "$1" | sed -e ' |
| 1762 | 1766 |
s/,,/,/g; |
| 1763 | 1767 |
s/^,//; |
| 1764 | 1768 |
s/,$// |
| 1765 | 1769 |
' |
| 1770 |
+ |
|
| 1771 |
+ $xtrace |
|
| 1766 | 1772 |
} |
| 1767 | 1773 |
|
| 1768 | 1774 |
# disable_all_services() removes all current services |
| ... | ... |
@@ -1780,6 +1786,10 @@ function disable_all_services {
|
| 1780 | 1780 |
# Uses global ``ENABLED_SERVICES`` |
| 1781 | 1781 |
# disable_negated_services |
| 1782 | 1782 |
function disable_negated_services {
|
| 1783 |
+ local xtrace |
|
| 1784 |
+ xtrace=$(set +o | grep xtrace) |
|
| 1785 |
+ set +o xtrace |
|
| 1786 |
+ |
|
| 1783 | 1787 |
local to_remove="" |
| 1784 | 1788 |
local remaining="" |
| 1785 | 1789 |
local service |
| ... | ... |
@@ -1797,6 +1807,8 @@ function disable_negated_services {
|
| 1797 | 1797 |
# go through the service list. if this service appears in the "to |
| 1798 | 1798 |
# be removed" list, drop it |
| 1799 | 1799 |
ENABLED_SERVICES=$(remove_disabled_services "$remaining" "$to_remove") |
| 1800 |
+ |
|
| 1801 |
+ $xtrace |
|
| 1800 | 1802 |
} |
| 1801 | 1803 |
|
| 1802 | 1804 |
# disable_service() prepares the services passed as argument to be |
| ... | ... |
@@ -1808,6 +1820,10 @@ function disable_negated_services {
|
| 1808 | 1808 |
# Uses global ``DISABLED_SERVICES`` |
| 1809 | 1809 |
# disable_service service [service ...] |
| 1810 | 1810 |
function disable_service {
|
| 1811 |
+ local xtrace |
|
| 1812 |
+ xtrace=$(set +o | grep xtrace) |
|
| 1813 |
+ set +o xtrace |
|
| 1814 |
+ |
|
| 1811 | 1815 |
local disabled_svcs="${DISABLED_SERVICES}"
|
| 1812 | 1816 |
local enabled_svcs=",${ENABLED_SERVICES},"
|
| 1813 | 1817 |
local service |
| ... | ... |
@@ -1819,6 +1835,8 @@ function disable_service {
|
| 1819 | 1819 |
done |
| 1820 | 1820 |
DISABLED_SERVICES=$(_cleanup_service_list "$disabled_svcs") |
| 1821 | 1821 |
ENABLED_SERVICES=$(_cleanup_service_list "$enabled_svcs") |
| 1822 |
+ |
|
| 1823 |
+ $xtrace |
|
| 1822 | 1824 |
} |
| 1823 | 1825 |
|
| 1824 | 1826 |
# enable_service() adds the services passed as argument to the |
| ... | ... |
@@ -1832,6 +1850,10 @@ function disable_service {
|
| 1832 | 1832 |
# Uses global ``ENABLED_SERVICES`` |
| 1833 | 1833 |
# enable_service service [service ...] |
| 1834 | 1834 |
function enable_service {
|
| 1835 |
+ local xtrace |
|
| 1836 |
+ xtrace=$(set +o | grep xtrace) |
|
| 1837 |
+ set +o xtrace |
|
| 1838 |
+ |
|
| 1835 | 1839 |
local tmpsvcs="${ENABLED_SERVICES}"
|
| 1836 | 1840 |
local service |
| 1837 | 1841 |
for service in $@; do |
| ... | ... |
@@ -1845,6 +1867,8 @@ function enable_service {
|
| 1845 | 1845 |
done |
| 1846 | 1846 |
ENABLED_SERVICES=$(_cleanup_service_list "$tmpsvcs") |
| 1847 | 1847 |
disable_negated_services |
| 1848 |
+ |
|
| 1849 |
+ $xtrace |
|
| 1848 | 1850 |
} |
| 1849 | 1851 |
|
| 1850 | 1852 |
# is_service_enabled() checks if the service(s) specified as arguments are |
| ... | ... |
@@ -1873,6 +1897,7 @@ function is_service_enabled {
|
| 1873 | 1873 |
local xtrace |
| 1874 | 1874 |
xtrace=$(set +o | grep xtrace) |
| 1875 | 1875 |
set +o xtrace |
| 1876 |
+ |
|
| 1876 | 1877 |
local enabled=1 |
| 1877 | 1878 |
local services=$@ |
| 1878 | 1879 |
local service |
| ... | ... |
@@ -1898,6 +1923,7 @@ function is_service_enabled {
|
| 1898 | 1898 |
[[ ${service} == "swift" && ${ENABLED_SERVICES} =~ "s-" ]] && enabled=0
|
| 1899 | 1899 |
[[ ${service} == s-* && ${ENABLED_SERVICES} =~ "swift" ]] && enabled=0
|
| 1900 | 1900 |
done |
| 1901 |
+ |
|
| 1901 | 1902 |
$xtrace |
| 1902 | 1903 |
return $enabled |
| 1903 | 1904 |
} |
| ... | ... |
@@ -1905,6 +1931,10 @@ function is_service_enabled {
|
| 1905 | 1905 |
# remove specified list from the input string |
| 1906 | 1906 |
# remove_disabled_services service-list remove-list |
| 1907 | 1907 |
function remove_disabled_services {
|
| 1908 |
+ local xtrace |
|
| 1909 |
+ xtrace=$(set +o | grep xtrace) |
|
| 1910 |
+ set +o xtrace |
|
| 1911 |
+ |
|
| 1908 | 1912 |
local service_list=$1 |
| 1909 | 1913 |
local remove_list=$2 |
| 1910 | 1914 |
local service |
| ... | ... |
@@ -1923,6 +1953,9 @@ function remove_disabled_services {
|
| 1923 | 1923 |
enabled="${enabled},$service"
|
| 1924 | 1924 |
fi |
| 1925 | 1925 |
done |
| 1926 |
+ |
|
| 1927 |
+ $xtrace |
|
| 1928 |
+ |
|
| 1926 | 1929 |
_cleanup_service_list "$enabled" |
| 1927 | 1930 |
} |
| 1928 | 1931 |
|