config: expand '~' and '~user' in paths

This commit is contained in:
Steve Reinhardt 2015-03-23 16:14:19 -07:00
parent 5302305255
commit c55749d998

View file

@ -27,7 +27,7 @@
# Authors: Ali Saidi
import os, sys
from os.path import isdir, join as joinpath
from os.path import join as joinpath
from os import environ as env
config_path = os.path.dirname(os.path.abspath(__file__))
@ -59,6 +59,9 @@ def system():
except KeyError:
path = [ '/dist/m5/system', '/n/poolfs/z/dist/m5/system' ]
# expand '~' and '~user' in paths
path = map(os.path.expanduser, path)
# filter out non-existent directories
system.path = filter(os.path.isdir, path)