Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

password parsing failure due to special characters has been fixed #549

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading