From 33098de98aa6e23f0aaa58b3963dedea1eaf1653 Mon Sep 17 00:00:00 2001 From: Benoit S Date: Tue, 23 Nov 2021 12:09:29 +0900 Subject: [PATCH] Use dict for data_directories --- deploy.py | 2 +- group_data/all.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deploy.py b/deploy.py index ba917d5..e340a86 100644 --- a/deploy.py +++ b/deploy.py @@ -26,7 +26,7 @@ server.user( present=True, ) -for directory in host.data.data_directories: +for directory in host.data.data_directories.keys(): files.directory( name=f'Make required directory {directory}', path=directory, diff --git a/group_data/all.py b/group_data/all.py index e93c17c..9253b91 100644 --- a/group_data/all.py +++ b/group_data/all.py @@ -19,9 +19,9 @@ unix_account = { 'shell': '/bin/false', } -data_directories = [ - f"{unix_account['home']}/data" -] +data_directories = { + f"{unix_account['home']}/data": '/etc/linkding/data' +} systemd = { 'Description': app['name'], @@ -34,7 +34,7 @@ systemd = { '+/etc/linkding' ], 'BindPaths': [ - f"{data_directories[0]}:/etc/linkding/data" + f"{list(data_directories.items())[0][0]}:{list(data_directories.items())[0][1]}" ], 'BindReadOnlyPaths': [ '/etc/resolv.conf',