1
0
Fork 0

unit: options are processed in the order there were defined

Now all units (e.g. [variables]) preserve order of options, e.g.
[variables]
c=1
b=${c}
a=${b}

The ${a} now correctly expands to '1' and not to '${b}'.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2017-04-06 10:56:18 +02:00
parent c4c7387978
commit 244917ec41
No known key found for this signature in database
GPG key ID: D8E1C00E076E840B

View file

@ -1,3 +1,5 @@
import collections
class Unit(object):
"""
Unit description.
@ -15,7 +17,7 @@ class Unit(object):
self._devices_udev_regex = config.pop("devices_udev_regex", None)
self._script_pre = config.pop("script_pre", None)
self._script_post = config.pop("script_post", None)
self._options = dict(config)
self._options = collections.OrderedDict(config)
@property
def name(self):