Skip to content

Commit e3cb626

Browse files
authored
Make API working in Windows
1 parent 16af89e commit e3cb626

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)