appmenus: fix handling VM name on command line
QubesOS/qubes-issues#2412
This commit is contained in:
parent
40b139ab82
commit
85b509cedc
@ -280,7 +280,7 @@ def process_appmenus_templates(appmenusext, vm, appmenus):
|
|||||||
old_icon = None
|
old_icon = None
|
||||||
if old_icon is None or icon != old_icon:
|
if old_icon is None or icon != old_icon:
|
||||||
icon.save(icondest)
|
icon.save(icondest)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
vm.log.warning('Failed to get icon for {0}: {1!s}'.\
|
vm.log.warning('Failed to get icon for {0}: {1!s}'.\
|
||||||
format(appmenu_file, e))
|
format(appmenu_file, e))
|
||||||
|
|
||||||
@ -313,9 +313,9 @@ def main(args=None):
|
|||||||
if env_vmname:
|
if env_vmname:
|
||||||
vm = args.app.domains[env_vmname]
|
vm = args.app.domains[env_vmname]
|
||||||
else:
|
else:
|
||||||
vm = args.vm
|
vm = args.domains[0]
|
||||||
|
|
||||||
if args.vm is None:
|
if vm is None:
|
||||||
parser.error("You must specify at least the VM name!")
|
parser.error("You must specify at least the VM name!")
|
||||||
|
|
||||||
if hasattr(vm, 'template'):
|
if hasattr(vm, 'template'):
|
||||||
@ -341,12 +341,14 @@ def main(args=None):
|
|||||||
|
|
||||||
process_appmenus_templates(appmenusext, vm, new_appmenus)
|
process_appmenus_templates(appmenusext, vm, new_appmenus)
|
||||||
|
|
||||||
appmenusext.appmenus_update(vm)
|
appmenusext.appicons_create(vm)
|
||||||
|
appmenusext.appmenus_create(vm)
|
||||||
if hasattr(vm, 'appvms'):
|
if hasattr(vm, 'appvms'):
|
||||||
for child_vm in vm.appvms:
|
for child_vm in vm.appvms:
|
||||||
try:
|
try:
|
||||||
|
appmenusext.appicons_create(child_vm)
|
||||||
appmenusext.appmenus_create(child_vm, refresh_cache=False)
|
appmenusext.appmenus_create(child_vm, refresh_cache=False)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
child_vm.log.error("Failed to recreate appmenus for "
|
child_vm.log.error("Failed to recreate appmenus for "
|
||||||
"'{0}': {1}".format(child_vm.name, str(e)))
|
"'{0}': {1}".format(child_vm.name, str(e)))
|
||||||
subprocess.call(['xdg-desktop-menu', 'forceupdate'])
|
subprocess.call(['xdg-desktop-menu', 'forceupdate'])
|
||||||
|
Loading…
Reference in New Issue
Block a user