vmware-archive / loginsight-export

Log Insight Export
Other
11 stars 7 forks source link

Running loginsight-export -h on windows without the HOME env variable causes error - need better handling #13

Closed yogita23p closed 7 years ago

yogita23p commented 7 years ago

C:\Users\yogitap\AppData\Local\Programs\Python\Python36-32\Scripts>loginsight-export -h Traceback (most recent call last): File "c:\users\yogitap\appdata\local\programs\python\python36-32\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\yogitap\appdata\local\programs\python\python36-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\yogitap\AppData\Local\Programs\Python\Python36-32\Scripts\loginsight-export.exe__main.py", line 9, in File "c:\users\yogitap\appdata\local\programs\python\python36-32\lib\site-packages\loginsightexport\main.py", line 188, in main parser, args = arguments() File "c:\users\yogitap\appdata\local\programs\python\python36-32\lib\site-packages\loginsightexport\main.py", line 68, in arguments default=os.path.join(os.environ['HOME'], ".netrc"), File "c:\users\yogitap\appdata\local\programs\python\python36-32\lib\os.py", line 669, in getitem__ raise KeyError(key) from None KeyError: 'HOME'

HOMEPATH=\Users\UserName USERPROFILE=C:\Users\UserName

danieldsj commented 7 years ago

I was able to reproduce this on my machine as well.

danieldsj commented 7 years ago

Wrote a small fix here: https://github.com/vmware/loginsight-export/pull/14

danieldsj commented 7 years ago

Fix was merged.