strip whitespace from key and value before inserting it into the config

before the following would produce four entries:

    container_config:
      - "lxc.network.flags=up"
      - "lxc.network.flags =up"
      - "lxc.network.flags= up"
      - "lxc.network.flags = up"

let's strip the whitespace and insert only one "lxc.network.flags = up"
into the final config

Signed-off-by: Evgeni Golov <evgeni@golov.de>
reviewable/pr18780/r1
Evgeni Golov 9 years ago
parent 474baaa831
commit c03e77a63a

@ -745,6 +745,8 @@ class LxcContainerManagement(object):
config_change = False
for key, value in parsed_options:
key = key.strip()
value = value.strip()
new_entry = '%s = %s\n' % (key, value)
for option_line in container_config:
# Look for key in config

Loading…
Cancel
Save