@@ -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
@@ -183,7 +185,8 @@ function die_if_not_set {
183
185
# err $LINENO "message"
184
186
function err {
185
187
local exitcode=$?
186
- local xtrace=$( set +o | grep xtrace)
188
+ local xtrace
189
+ xtrace=$( set +o | grep xtrace)
187
190
set +o xtrace
188
191
local msg=" [ERROR] ${BASH_SOURCE[2]} :$1 $2 "
189
192
echo $msg 1>&2 ;
@@ -200,7 +203,8 @@ function err {
200
203
# err_if_not_set $LINENO env-var "message"
201
204
function err_if_not_set {
202
205
local exitcode=$?
203
- local xtrace=$( set +o | grep xtrace)
206
+ local xtrace
207
+ xtrace=$( set +o | grep xtrace)
204
208
set +o xtrace
205
209
local line=$1 ; shift
206
210
local evar=$1 ; shift
@@ -236,7 +240,8 @@ function is_set {
236
240
# warn $LINENO "message"
237
241
function warn {
238
242
local exitcode=$?
239
- local xtrace=$( set +o | grep xtrace)
243
+ local xtrace
244
+ xtrace=$( set +o | grep xtrace)
240
245
set +o xtrace
241
246
local msg=" [WARNING] ${BASH_SOURCE[2]} :$1 $2 "
242
247
echo $msg
@@ -986,7 +991,8 @@ function _get_package_dir {
986
991
# Uses globals ``OFFLINE``, ``*_proxy``
987
992
# apt_get operation package [package ...]
988
993
function apt_get {
989
- local xtrace=$( set +o | grep xtrace)
994
+ local xtrace
995
+ xtrace=$( set +o | grep xtrace)
990
996
set +o xtrace
991
997
992
998
[[ " $OFFLINE " = " True" || -z " $@ " ]] && return
@@ -1055,7 +1061,8 @@ function _parse_package_files {
1055
1061
# - ``# dist:DISTRO`` or ``dist:DISTRO1,DISTRO2`` limits the selection
1056
1062
# of the package to the distros listed. The distro names are case insensitive.
1057
1063
function get_packages {
1058
- local xtrace=$( set +o | grep xtrace)
1064
+ local xtrace
1065
+ xtrace=$( set +o | grep xtrace)
1059
1066
set +o xtrace
1060
1067
local services=$@
1061
1068
local package_dir=$( _get_package_dir)
@@ -1123,7 +1130,8 @@ function get_packages {
1123
1130
# The same metadata used in the main DevStack prerequisite files may be used
1124
1131
# in these prerequisite files, see get_packages() for more info.
1125
1132
function get_plugin_packages {
1126
- local xtrace=$( set +o | grep xtrace)
1133
+ local xtrace
1134
+ xtrace=$( set +o | grep xtrace)
1127
1135
set +o xtrace
1128
1136
local files_to_parse=" "
1129
1137
local package_dir=" "
@@ -1148,7 +1156,8 @@ function update_package_repo {
1148
1156
fi
1149
1157
1150
1158
if is_ubuntu; then
1151
- local xtrace=$( set +o | grep xtrace)
1159
+ local xtrace
1160
+ xtrace=$( set +o | grep xtrace)
1152
1161
set +o xtrace
1153
1162
if [[ " $REPOS_UPDATED " != " True" || " $RETRY_UPDATE " = " True" ]]; then
1154
1163
# if there are transient errors pulling the updates, that's fine.
@@ -1854,7 +1863,8 @@ function enable_service {
1854
1863
# Uses global ``ENABLED_SERVICES``
1855
1864
# is_service_enabled service [service ...]
1856
1865
function is_service_enabled {
1857
- local xtrace=$( set +o | grep xtrace)
1866
+ local xtrace
1867
+ xtrace=$( set +o | grep xtrace)
1858
1868
set +o xtrace
1859
1869
local enabled=1
1860
1870
local services=$@
@@ -1933,7 +1943,8 @@ function use_exclusive_service {
1933
1943
# Only run the command if the target file (the last arg) is not on an
1934
1944
# NFS filesystem.
1935
1945
function _safe_permission_operation {
1936
- local xtrace=$( set +o | grep xtrace)
1946
+ local xtrace
1947
+ xtrace=$( set +o | grep xtrace)
1937
1948
set +o xtrace
1938
1949
local args=( $@ )
1939
1950
local last
0 commit comments