core: use vm.absolute_path to parse paths in qubes.xml

This makes easier to handle some corner cases.

qubesos/qubes-issues#1124
Reported by @doncohen, thanks @wyory for providing more details.
This commit is contained in:
Marek Marczykowski-Górecki 2015-09-04 01:57:59 +02:00
parent 730db56623
commit 4e1f6b5bd5

View File

@ -51,22 +51,21 @@ system_path['appmenu_remove_cmd'] = \
def QubesVm_get_attrs_config(self, attrs):
attrs["appmenus_templates_dir"] = {
"func": lambda x:
os.path.join(self.dir_path, vm_files["appmenus_templates_subdir"])
self.absolute_path(vm_files["appmenus_templates_subdir"], None)
if self.updateable else
(self.template.appmenus_templates_dir if self.template is not None
else None)
}
attrs["appmenus_template_icons_dir"] = {
"func": lambda x:
os.path.join(self.dir_path,
vm_files["appmenus_template_icons_subdir"])
self.absolute_path(vm_files["appmenus_template_icons_subdir"], None)
if self.updateable else
(self.template.appmenus_template_icons_dir
if self.template is not None else None)
}
attrs["appmenus_icons_dir"] = {
"func": lambda x:
os.path.join(self.dir_path, vm_files["appmenus_icons_subdir"])}
self.absolute_path(vm_files["appmenus_icons_subdir"], None)}
return attrs