container script: Must convert env. var. string to a Path object

Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
fliu authored and Veiko Aasa committed 2021-03-30 21:06:58 +03:00
1 parent 968726d152
commit 26b6bbcb52
1 file changed
+6 -5
+6 -5
View File
@@ -383,11 +383,11 @@ def _verify_dependencies():
def _get_systemd_nspawn_version():
"""Retrieve and store systemd-nspawn version (same as systemd)."""
try:
process = subprocess.run(['systemd', '--version'], stdout=subprocess.PIPE,
check=True)
process = subprocess.run(['systemd', '--version'],
stdout=subprocess.PIPE, check=True)
except FileNotFoundError:
process = subprocess.run(['/usr/lib/systemd/systemd', '--version'], stdout=subprocess.PIPE,
check=True)
process = subprocess.run(['/usr/lib/systemd/systemd', '--version'],
stdout=subprocess.PIPE, check=True)
global systemd_version
systemd_version = float(process.stdout.decode().split()[1])
@@ -484,7 +484,8 @@ def _get_overlay_folder(distribution):
"""Return the writable folder that should be exposed into container."""
default_data_dir = pathlib.Path.home() / '.local' / 'share'
data_folder = os.environ.get('XDG_DATA_HOME', default_data_dir)
folder = data_folder / 'freedombox-container' / 'overlay' / distribution
folder = pathlib.Path(data_folder) / \
'freedombox-container' / 'overlay' / distribution
return folder.resolve()