@@ -111,7 +111,8 @@ function write_clouds_yaml {
111
111
# Accepts as True: 1 yes Yes YES true True TRUE
112
112
# VAR=$(trueorfalse default-value test-value)
113
113
function trueorfalse {
114
- local xtrace=$( set +o | grep xtrace)
114
+ local xtrace
115
+ xtrace=$( set +o | grep xtrace)
115
116
set +o xtrace
116
117
117
118
local default=$1
@@ -169,7 +170,8 @@ function die {
169
170
# die_if_not_set $LINENO env-var "message"
170
171
function die_if_not_set {
171
172
local exitcode=$?
172
- local xtrace=$( set +o | grep xtrace)
173
+ local xtrace
174
+ xtrace=$( set +o | grep xtrace)
173
175
set +o xtrace
174
176
local line=$1 ; shift
175
177
local evar=$1 ; shift
@@ -189,7 +191,8 @@ function deprecated {
189
191
# err $LINENO "message"
190
192
function err {
191
193
local exitcode=$?
192
- local xtrace=$( set +o | grep xtrace)
194
+ local xtrace
195
+ xtrace=$( set +o | grep xtrace)
193
196
set +o xtrace
194
197
local msg=" [ERROR] ${BASH_SOURCE[2]} :$1 $2 "
195
198
echo $msg 1>&2 ;
@@ -206,7 +209,8 @@ function err {
206
209
# err_if_not_set $LINENO env-var "message"
207
210
function err_if_not_set {
208
211
local exitcode=$?
209
- local xtrace=$( set +o | grep xtrace)
212
+ local xtrace
213
+ xtrace=$( set +o | grep xtrace)
210
214
set +o xtrace
211
215
local line=$1 ; shift
212
216
local evar=$1 ; shift
@@ -242,7 +246,8 @@ function is_set {
242
246
# warn $LINENO "message"
243
247
function warn {
244
248
local exitcode=$?
245
- local xtrace=$( set +o | grep xtrace)
249
+ local xtrace
250
+ xtrace=$( set +o | grep xtrace)
246
251
set +o xtrace
247
252
local msg=" [WARNING] ${BASH_SOURCE[2]} :$1 $2 "
248
253
echo $msg
@@ -963,7 +968,8 @@ function _get_package_dir {
963
968
# Uses globals ``OFFLINE``, ``*_proxy``
964
969
# apt_get operation package [package ...]
965
970
function apt_get {
966
- local xtrace=$( set +o | grep xtrace)
971
+ local xtrace
972
+ xtrace=$( set +o | grep xtrace)
967
973
set +o xtrace
968
974
969
975
[[ " $OFFLINE " = " True" || -z " $@ " ]] && return
@@ -1032,7 +1038,8 @@ function _parse_package_files {
1032
1038
# - ``# dist:DISTRO`` or ``dist:DISTRO1,DISTRO2`` limits the selection
1033
1039
# of the package to the distros listed. The distro names are case insensitive.
1034
1040
function get_packages {
1035
- local xtrace=$( set +o | grep xtrace)
1041
+ local xtrace
1042
+ xtrace=$( set +o | grep xtrace)
1036
1043
set +o xtrace
1037
1044
local services=$@
1038
1045
local package_dir=$( _get_package_dir)
@@ -1100,7 +1107,8 @@ function get_packages {
1100
1107
# The same metadata used in the main DevStack prerequisite files may be used
1101
1108
# in these prerequisite files, see get_packages() for more info.
1102
1109
function get_plugin_packages {
1103
- local xtrace=$( set +o | grep xtrace)
1110
+ local xtrace
1111
+ xtrace=$( set +o | grep xtrace)
1104
1112
set +o xtrace
1105
1113
local files_to_parse=" "
1106
1114
local package_dir=" "
@@ -1125,7 +1133,8 @@ function update_package_repo {
1125
1133
fi
1126
1134
1127
1135
if is_ubuntu; then
1128
- local xtrace=$( set +o | grep xtrace)
1136
+ local xtrace
1137
+ xtrace=$( set +o | grep xtrace)
1129
1138
set +o xtrace
1130
1139
if [[ " $REPOS_UPDATED " != " True" || " $RETRY_UPDATE " = " True" ]]; then
1131
1140
# if there are transient errors pulling the updates, that's fine.
@@ -1841,7 +1850,8 @@ function enable_service {
1841
1850
# Uses global ``ENABLED_SERVICES``
1842
1851
# is_service_enabled service [service ...]
1843
1852
function is_service_enabled {
1844
- local xtrace=$( set +o | grep xtrace)
1853
+ local xtrace
1854
+ xtrace=$( set +o | grep xtrace)
1845
1855
set +o xtrace
1846
1856
local enabled=1
1847
1857
local services=$@
@@ -1920,7 +1930,8 @@ function use_exclusive_service {
1920
1930
# Only run the command if the target file (the last arg) is not on an
1921
1931
# NFS filesystem.
1922
1932
function _safe_permission_operation {
1923
- local xtrace=$( set +o | grep xtrace)
1933
+ local xtrace
1934
+ xtrace=$( set +o | grep xtrace)
1924
1935
set +o xtrace
1925
1936
local args=( $@ )
1926
1937
local last
0 commit comments