Skip to content

Commit

Permalink
Merge pull request #549 from Teingi/2.5.x_1113
Browse files Browse the repository at this point in the history
password parsing failure due to special characters has been fixed
  • Loading branch information
wayyoungboy authored Nov 14, 2024
2 parents 53dedd4 + 69d0fdd commit 934c039
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions common/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,17 +1217,20 @@ def validate_db_info(db_info, stdio=None):
@staticmethod
def parse_env(env_string, stdio=None):
env_dict = {}
inner_str = env_string[1:-1]
inner_str = env_string[1:-1].strip()
pairs = inner_str.split(',')
for pair in pairs:
key_value = pair.strip().split('=')
pair = pair.strip()
key_value = pair.split('=', 1)
if len(key_value) == 2:
key, value = key_value
key = key.strip()
value = value.strip()
if value.startswith('"') and value.endswith('"'):
value = value[1:-1]
elif value.startswith("'") and value.endswith("'"):
value = value[1:-1]
env_dict[key.strip()] = value.strip()
env_dict[key] = value
return env_dict

@staticmethod
Expand Down

0 comments on commit 934c039

Please sign in to comment.