-
Notifications
You must be signed in to change notification settings - Fork 371
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
v2.2.11 - questionable split() call in "common/conf.py" #714
Comments
@u6006 I'm not seeing what you're seeing. Could you provide a concrete example that fails? Admittedly, this is very simple parsing code. It is not intended to be, as with most Unix-style configuration files, a general purpose, able to handle all kinds of strings, parser. It is intended to handle only the most basic cases. If you can provide a legitimate failure, we'll gladly fix it. |
the code on line 43 splits the input line by spaces first, so chars after the 1st space was filtered out by "line.split()[0]...", as such, the two examples posted above will fail to be parsed k=" v" will get empty value If it's intentional, it's not a bug (but the comment should be added to clarify), or else it should be refactored to cover the cases that I listed. |
Agree. Removing the 1st split() will handle both my cases though the latter is not supported. |
Fixed by #729. |
Waagent version (cloned on 05/14/2017)
grep "^AGENT_VERSION = " common/version.py
AGENT_VERSION = '2.2.11'
Is there any special consideration for the following split() call at line Bugfix runscript for Gentoo Linux #43? or else it cannot handle spaces in the value 'k=" v"' or 'k="v0 v1"' (in common/conf.py)
41 for line in content.split('\n'):
42 if not line.startswith("#") and "=" in line:
43 parts = line.split()[0].split('=')
44 value = parts[1].strip("" ")
The text was updated successfully, but these errors were encountered: