mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
apache: Fix failure during app update
- During application update, if the last_updated_version is not provided for the WebServer component, app's update to next version fails. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
a35c320ebd
commit
5af2d44f83
@ -44,7 +44,7 @@ class Webserver(app.LeaderComponent):
|
|||||||
self.kind = kind
|
self.kind = kind
|
||||||
self.urls = urls or []
|
self.urls = urls or []
|
||||||
self.expect_redirects = expect_redirects
|
self.expect_redirects = expect_redirects
|
||||||
self.last_updated_version = last_updated_version
|
self.last_updated_version = last_updated_version or 0
|
||||||
|
|
||||||
def is_enabled(self):
|
def is_enabled(self):
|
||||||
"""Return whether the Apache configuration is enabled."""
|
"""Return whether the Apache configuration is enabled."""
|
||||||
|
|||||||
@ -109,6 +109,14 @@ def test_webserver_setup(service_reload, service_restart):
|
|||||||
return self.enabled
|
return self.enabled
|
||||||
|
|
||||||
app1 = AppTest()
|
app1 = AppTest()
|
||||||
|
|
||||||
|
# Don't fail when last_updated_version is not provided.
|
||||||
|
webserver1 = Webserver('test-webserver1', 'test-config')
|
||||||
|
assert webserver1.last_updated_version == 0
|
||||||
|
webserver1.setup(old_version=10)
|
||||||
|
service_reload.assert_not_called()
|
||||||
|
service_restart.assert_not_called()
|
||||||
|
|
||||||
webserver1 = Webserver('test-webserver1', 'test-config',
|
webserver1 = Webserver('test-webserver1', 'test-config',
|
||||||
last_updated_version=5)
|
last_updated_version=5)
|
||||||
for version in (0, 5, 6):
|
for version in (0, 5, 6):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user