Skip to content

Commit a627655

Browse files
Correctly handle the path if it's missing
1 parent 61595fb commit a627655

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

juju/client/jujudata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ class FileJujuData(JujuData):
121121
'''Provide access to the Juju client configuration files.
122122
Any configuration file is read once and then cached.'''
123123
def __init__(self):
124-
self.path = os.environ.get('JUJU_DATA') or '~/.local/share/juju'
124+
default_data_dir = pathlib.Path(pathlib.Path.home(), ".local", "share", "juju")
125+
self.path = os.environ.get('JUJU_DATA', default_data_dir)
125126
self.path = os.path.abspath(os.path.expanduser(self.path))
126127
# _loaded keeps track of the loaded YAML from
127128
# the Juju data files so we don't need to load the same

0 commit comments

Comments
 (0)