From 244917ec41676d7f1af720a5d3ff717160b8d2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Thu, 6 Apr 2017 10:56:18 +0200 Subject: [PATCH] unit: options are processed in the order there were defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tuned/profiles/unit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tuned/profiles/unit.py b/tuned/profiles/unit.py index 8fdc593..3052a81 100644 --- a/tuned/profiles/unit.py +++ b/tuned/profiles/unit.py @@ -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):