Fix a case when HOME is set but empty

This commit is contained in:
Darko Poljak 2018-02-27 23:07:52 +01:00
parent 44673131fc
commit 2b5f1a0148
2 changed files with 8 additions and 2 deletions

View file

@ -175,6 +175,11 @@ def str_hash(s):
def home_dir():
if 'HOME' in os.environ:
return os.path.join(os.environ['HOME'], ".cdist")
home = os.environ['HOME']
if home:
rv = os.path.join(home, ".cdist")
else:
rv = None
else:
return None
rv = None
return rv

View file

@ -6,6 +6,7 @@ next:
* Core: Add -4 and -6 params to force IPv4, IPv6 addresses respectively (Darko Poljak)
* Type __package_update_index: Fix messaging (Thomas Eckert)
* Type __package_dpkg: Add state parameter and messaging (Thomas Eckert)
* Core: Fix a case when HOME is set but empty (Darko Poljak)
4.8.0: 2018-02-14
* Core: Skip empty lines in parameter files (Darko Poljak)