Skip to content

Commit

Permalink
Merge pull request #160 from deese/patch-1
Browse files Browse the repository at this point in the history
Make API working in Windows
  • Loading branch information
lsmithpanw authored Oct 30, 2023
2 parents 30ac4b6 + e3cb626 commit feebf8c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion prismacloud/api/pc_lib_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
except NameError:
pass

try:
from pathlib import Path
homefolder = str(Path.home())
except:
if "USERPROFILE" in os.environ:
homefolder = os.environ["USERPROFILE"]
else:
homefolder = os.environ["HOME"]

# --Description-- #

# Prisma Cloud Helper library.
Expand All @@ -26,7 +35,7 @@
class PrismaCloudUtility():
""" Prisma Cloud Utility Class """

CONFIG_DIRECTORY = os.path.join(os.environ['HOME'], '.prismacloud')
CONFIG_DIRECTORY = os.path.join(homefolder, '.prismacloud')
DEFAULT_CONFIG_FILE = os.path.join(CONFIG_DIRECTORY, 'credentials.json')

@classmethod
Expand Down

0 comments on commit feebf8c

Please sign in to comment.