infinoted: Don't enable app when setup is rerun

Tests:

- When app is freshly installed, app is enabled.

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2023-07-26 18:27:30 -07:00 committed by James Valleroy
parent e6b88a48b9
commit 3172c6a7b4
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 2 additions and 4 deletions

View File

@ -77,7 +77,8 @@ class InfinotedApp(app_module.App):
"""Install and configure the app."""
super().setup(old_version)
privileged.setup()
self.enable()
if not old_version:
self.enable()
def uninstall(self):
"""De-configure and uninstall the app."""

View File

@ -9,7 +9,6 @@ import shutil
import subprocess
import time
from plinth import action_utils
from plinth.actions import privileged
DATA_DIR = '/var/lib/infinoted'
@ -167,8 +166,6 @@ def setup():
shutil.chown(KEY_DIR + '/infinoted-key.pem', user='infinoted',
group='infinoted')
action_utils.service_enable('infinoted')
@privileged
def uninstall():