Fix 'dict' object has no attribute split

Now first check if vdata exists in dict
This commit is contained in:
turnred 2015-09-10 11:13:29 +02:00
parent 083a2bdf93
commit e927009c37

View File

@ -76,7 +76,8 @@ def get_path():
ret = __salt__['reg.read_key']('HKEY_LOCAL_MACHINE',
'SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment',
'PATH')
ret = ret['vdata'].split(';')
if 'vdata' in ret.keys():
ret = ret['vdata'].split(';')
# Trim ending backslash
return list(map(_normalize_dir, ret))