mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 12:46:39 +00:00
feat: Allow turning on new services even from older clients
This commit is contained in:
parent
bab2f17581
commit
84729382ea
|
@ -294,6 +294,18 @@ class TemplatedService(Service):
|
|||
|
||||
def enable(self):
|
||||
"""Enable the service. Usually this means enabling systemd unit."""
|
||||
if "location" in self.options:
|
||||
name = self.get_id()
|
||||
with WriteUserData() as user_data:
|
||||
if "modules" not in user_data:
|
||||
user_data["modules"] = {}
|
||||
if name not in user_data["modules"]:
|
||||
user_data["modules"][name] = {}
|
||||
if "location" not in user_data["modules"][name]:
|
||||
user_data["modules"][name]["location"] = (
|
||||
BlockDevices().get_root_block_device().name
|
||||
)
|
||||
|
||||
self._set_enable(True)
|
||||
|
||||
def disable(self):
|
||||
|
|
Loading…
Reference in a new issue