Skip to content

Commit

Permalink
Fix retrieve_puf function
Browse files Browse the repository at this point in the history
  • Loading branch information
kcreekdev committed Mar 1, 2024
1 parent 81bcccd commit 8da199f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cs-config/cs_config/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ def retrieve_puf(
if puf_s3_file_location and has_credentials and s3_reader_installed:
print("Reading puf from S3 bucket.", puf_s3_file_location)
fs = S3FileSystem(key=AWS_ACCESS_KEY_ID, secret=AWS_SECRET_ACCESS_KEY,)
with fs.open(PUF_S3_FILE_NAME) as f:
with fs.open(puf_s3_file_location) as f:
# Skips over header from top of file.
puf_df = pd.read_csv(f, compression="gzip")
puf_df = pd.read_csv(f)
return puf_df
elif Path("puf.csv.gz").exists():
print("Reading puf from puf.csv.gz.")
Expand All @@ -367,7 +367,8 @@ def retrieve_puf(
return pd.read_csv("puf.csv")
else:
warnings.warn(
f"PUF file not available (has_credentials={has_credentials}, "
f"PUF file not available (puf_location={puf_s3_file_location}, "
f"has_credentials={has_credentials}, "
f"s3_reader_installed={s3_reader_installed})"
)
return None

0 comments on commit 8da199f

Please sign in to comment.