Expand variables in the 'devices' option
Variables in the 'devices' option were not being expanded. This is bad. It shows that the current variable expansion system is broken. We need to come up with a consistent, well-defined way of expanding variables. Preferably it should be done all in one place. The expansion is probably still not done for options 'type', 'enabled', 'replace', 'devices_udev_regex', 'script_pre' and 'script_post'. Let's deal with that later, as we don't need it in our profiles right now. Related: rhbz#1490399 Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
parent
2e4cb7339b
commit
d2557284f7
1 changed files with 6 additions and 0 deletions
|
|
@ -60,8 +60,14 @@ class Loader(object):
|
|||
if "variables" in final_profile.units:
|
||||
self._variables.add_from_cfg(final_profile.units["variables"].options)
|
||||
del(final_profile.units["variables"])
|
||||
# FIXME hack, do all variable expansions in one place
|
||||
self._expand_vars_in_devices(final_profile)
|
||||
return final_profile
|
||||
|
||||
def _expand_vars_in_devices(self, profile):
|
||||
for unit in profile.units:
|
||||
profile.units[unit].devices = self._variables.expand(profile.units[unit].devices)
|
||||
|
||||
def _load_profile(self, profile_names, profiles, processed_files):
|
||||
for name in profile_names:
|
||||
filename = self._profile_locator.get_config(name, processed_files)
|
||||
|
|
|
|||
Loading…
Reference in a new issue