mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
ikiwiki: Initialize shortcuts during post-init setup
In CI tests, when running 'run --list-dependencies', init for ikiwiki fails with
the following error. Fix that.
Exception while running init for <module 'plinth.modules.ikiwiki' from '/builds//freedombox/plinth/modules/ikiwiki/__init__.py'>: Action must exist in action directory.
Traceback (most recent call last):
File "/builds//freedombox/plinth/app.py", line 536, in _initialize_module
module.app = app_class()
File "/builds//freedombox/plinth/modules/ikiwiki/__init__.py", line 61, in __init__
self.refresh_sites()
File "/builds//freedombox/plinth/modules/ikiwiki/__init__.py", line 102, in refresh_sites
sites = actions.run('ikiwiki', ['get-sites']).split('\n')
File "/builds//freedombox/plinth/actions.py", line 95, in run
return _run(action, options, input, run_in_background, False)
File "/builds//freedombox/plinth/actions.py", line 147, in _run
raise ValueError('Action must exist in action directory.')
ValueError: Action must exist in action directory.
Tests:
- Shortcuts for ikiwiki show up properly on the front page after FreedomBox
daemon is restarted.
- Salsa CI no longer show the above error during --list-dependencies.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
6199718a19
commit
a7f3677c0e
@ -58,8 +58,6 @@ class IkiwikiApp(app_module.App):
|
||||
'ikiwiki:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
self.refresh_sites()
|
||||
|
||||
packages = Packages('packages-ikiwiki', [
|
||||
'ikiwiki', 'libdigest-sha-perl', 'libxml-writer-perl',
|
||||
'xapian-omega', 'libsearch-xapian-perl', 'libimage-magick-perl'
|
||||
@ -83,6 +81,10 @@ class IkiwikiApp(app_module.App):
|
||||
**manifest.backup)
|
||||
self.add(backup_restore)
|
||||
|
||||
def post_init(self):
|
||||
"""Perform post initialization operations."""
|
||||
self.refresh_sites()
|
||||
|
||||
def add_shortcut(self, site, title):
|
||||
"""Add an ikiwiki shortcut to frontpage."""
|
||||
shortcut = frontpage.Shortcut('shortcut-ikiwiki-' + site, title,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user