Skip to content
Snippets Groups Projects
Commit dc91a698 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Check if the tmp candidates are writable

Check if the candidate directories that are used to host temporary data
are writable by the media.

Thanks to vkoukis@gmail.com for the bug report
parent f6e9dee7
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2014 GRNET S.A.
# Copyright (C) 2011-2015 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -41,7 +41,10 @@ def get_tmp_dir(default=None):
if default is not None:
return default
TMP_CANDIDATES = ['/var/tmp', os.path.expanduser('~'), '/mnt']
# TODO: I need to find a better way of choosing temporary directories.
# Maybe check all available mount points.
TMP_CANDIDATES = [t for t in ('/var/tmp', os.path.expanduser('~'), '/mnt')
if os.access(t, os.W_OK)]
space = [free_space(t) for t in TMP_CANDIDATES]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment