Skip to content

Commit feebf8c

Browse files
authored
Merge pull request #160 from deese/patch-1
Make API working in Windows
2 parents 30ac4b6 + e3cb626 commit feebf8c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

prismacloud/api/pc_lib_utility.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
except NameError:
1818
pass
1919

20+
try:
21+
from pathlib import Path
22+
homefolder = str(Path.home())
23+
except:
24+
if "USERPROFILE" in os.environ:
25+
homefolder = os.environ["USERPROFILE"]
26+
else:
27+
homefolder = os.environ["HOME"]
28+
2029
# --Description-- #
2130

2231
# Prisma Cloud Helper library.
@@ -26,7 +35,7 @@
2635
class PrismaCloudUtility():
2736
""" Prisma Cloud Utility Class """
2837

29-
CONFIG_DIRECTORY = os.path.join(os.environ['HOME'], '.prismacloud')
38+
CONFIG_DIRECTORY = os.path.join(homefolder, '.prismacloud')
3039
DEFAULT_CONFIG_FILE = os.path.join(CONFIG_DIRECTORY, 'credentials.json')
3140

3241
@classmethod

0 commit comments

Comments
 (0)