@@ -24,7 +24,7 @@ if [ ! -f "$FILE" ]; then
24
24
exit 1
25
25
fi
26
26
27
- if [[ " $1 " != * .xml ]]; then
27
+ if [[ " $FILE " != * .xml ]]; then
28
28
echo " The file provided is not an XML file. Exiting...."
29
29
exit 1
30
30
fi
63
63
done
64
64
65
65
# Mapping for renaming configurations
66
- declare -A rename_configs_map =(
66
+ declare -A renameConfigsMap =(
67
67
[" autothrottling.enable" ]=" enable.autothrottling" # fs.azure.autothrottling.enable to fs.azure.enable.autothrottling
68
68
[" rename.dir" ]=" rename.key" # fs.azure.atomic.rename.dir to fs.azure.atomic.rename.key
69
69
[" block.blob.buffered.pread.disable" ]=" buffered.pread.disable" # fs.azure.block.blob.buffered.pread.disable to fs.azure.buffered.pread.disable
@@ -72,14 +72,14 @@ declare -A rename_configs_map=(
72
72
)
73
73
74
74
# Configs not supported in ABFS
75
- unsupported_configs_list =(
75
+ unsupportedConfigsList =(
76
76
" fs.azure.page.blob.dir"
77
77
" fs.azure.block.blob.with.compaction.dir"
78
78
" fs.azure.store.blob.md5"
79
79
)
80
80
81
81
# Configurations not required in ABFS Driver and can be removed
82
- obsolete_configs_list =(
82
+ obseleteConfigsList =(
83
83
" azure.authorization" # fs.azure.authorization, fs.azure.authorization.caching.enable , fs.azure.authorization.caching.maxentries, fs.azure.authorization.cacheentry.expiry.period, fs.azure.authorization.remote.service.urls
84
84
" azure.selfthrottling" # fs.azure.selfthrottling.enable, fs.azure.selfthrottling.read.factor, fs.azure.selfthrottling.write.factor
85
85
" azure.saskey" # fs.azure.saskey.cacheentry.expiry.period , fs.azure.saskey.usecontainersaskeyforallaccess
@@ -107,7 +107,7 @@ obsolete_configs_list=(
107
107
)
108
108
109
109
# Stop the script if any unsupported config is found
110
- for key in " ${unsupported_configs_list [@]} " ; do
110
+ for key in " ${unsupportedConfigsList [@]} " ; do
111
111
if grep -q " $key " " $OUTPUT_FILE " ; then
112
112
echo " Remove the following configuration from file and rerun: '$key '"
113
113
failure=true
@@ -122,14 +122,14 @@ if [ "$failure" = true ]; then
122
122
fi
123
123
124
124
# Renaming the configs
125
- for old in " ${! rename_configs_map [@]} " ; do
126
- new=" ${rename_configs_map [$old]} "
125
+ for old in " ${! renameConfigsMap [@]} " ; do
126
+ new=" ${renameConfigsMap [$old]} "
127
127
xmlstarlet ed -L -u " //property/name[contains(., '$old ')]" -x " concat(substring-before(., '$old '),
128
128
'$new ', substring-after(., '$old '))" " $OUTPUT_FILE "
129
129
done
130
130
131
131
# Remove the obsolete configs
132
- for key in " ${obsolete_configs_list [@]} " ; do
132
+ for key in " ${obseleteConfigsList [@]} " ; do
133
133
xmlstarlet ed -L -d " //property[name[contains(text(), '$key ')]]" " $OUTPUT_FILE "
134
134
done
135
135
0 commit comments