Config string parsing fails if value contains an '='
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Autopilot |
Fix Released
|
Medium
|
Christopher Lee | ||
autopilot (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Vivid |
New
|
Undecided
|
Unassigned |
Bug Description
Config string parsing fails if the value of a parameter contains an '='.
For example with ubuntu-sanity-tests if the WiFi passphrase contains an '=' it fails with:
=====
Traceback (most recent call last):
File "/tmp/adt-
self.
File "/tmp/adt-
config = get_test_
File "/tmp/adt-
return ConfigDict(
File "/tmp/adt-
"Invalid configuration string '{}'".format(
ValueError: Invalid configuration string 'device_
=====
This is because the string key=value is split on '=' without limit. A possible patch is:
====
=== modified file 'autopilot/
--- autopilot/
+++ autopilot/
@@ -74,7 +74,7 @@
for item in config_
if not item:
- parts = item.split('=')
+ parts = item.split('=', 1)
if len(parts) == 1:
elif len(parts) == 2:
====
Related branches
- PS Jenkins bot: Approve (continuous-integration)
- Leo Arias (community): Approve
-
Diff: 57 lines (+19/-9)2 files modifiedautopilot/_config.py (+8/-8)
autopilot/tests/unit/test_config.py (+11/-1)
Changed in autopilot: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in autopilot: | |
status: | Triaged → In Progress |
assignee: | nobody → Christopher Lee (veebers) |
Changed in autopilot: | |
status: | Fix Committed → Fix Released |
Changed in autopilot (Ubuntu): | |
status: | New → Fix Released |
Fix committed into lp:autopilot at revision None, scheduled for release in autopilot, milestone 1.4