rename var + comment
This commit is contained in:
parent
fac6f970bb
commit
f6a0937b22
|
@ -1097,10 +1097,11 @@ class ConfigService:
|
||||||
def _encrypt_or_decrypt_config(config, is_decrypt=False):
|
def _encrypt_or_decrypt_config(config, is_decrypt=False):
|
||||||
for config_arr_as_array in (ENCRYPTED_CONFIG_ARRAYS + ENCRYPTED_CONFIG_STRINGS):
|
for config_arr_as_array in (ENCRYPTED_CONFIG_ARRAYS + ENCRYPTED_CONFIG_STRINGS):
|
||||||
config_arr = config
|
config_arr = config
|
||||||
prev_config_arr = None
|
parent_config_arr = None
|
||||||
|
|
||||||
|
# Because the config isn't flat, this for-loop gets the actual config value out of the config
|
||||||
for config_key_part in config_arr_as_array:
|
for config_key_part in config_arr_as_array:
|
||||||
prev_config_arr = config_arr
|
parent_config_arr = config_arr
|
||||||
config_arr = config_arr[config_key_part]
|
config_arr = config_arr[config_key_part]
|
||||||
|
|
||||||
if isinstance(config_arr, collections.Sequence) and not isinstance(config_arr, string_types):
|
if isinstance(config_arr, collections.Sequence) and not isinstance(config_arr, string_types):
|
||||||
|
@ -1112,7 +1113,7 @@ class ConfigService:
|
||||||
else:
|
else:
|
||||||
config_arr[i] = encryptor.dec(config_arr[i]) if is_decrypt else encryptor.enc(config_arr[i])
|
config_arr[i] = encryptor.dec(config_arr[i]) if is_decrypt else encryptor.enc(config_arr[i])
|
||||||
else:
|
else:
|
||||||
prev_config_arr[config_arr_as_array[-1]] =\
|
parent_config_arr[config_arr_as_array[-1]] =\
|
||||||
encryptor.dec(config_arr) if is_decrypt else encryptor.enc(config_arr)
|
encryptor.dec(config_arr) if is_decrypt else encryptor.enc(config_arr)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue