Skip to content

Commit 6cb241e

Browse files
committed
fix: resolve undefined variable and add env validation in AckKubestronautsReceived.py
1. Renamed variable from 'pwd' to 'KUBESTRONAUT_RECEIVERS' to match its usage on line 29. 2. Added validation to check if the environment variable is set, providing a clear error message instead of a cryptic runtime error. Signed-off-by: LALANI DEVARSHI <thelogical369@gmail.com>
1 parent 6ff6106 commit 6cb241e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Kubestronaut/AckKubestronautsReceived.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919

2020
load_dotenv()
2121
# Store credentials
22-
pwd = os.getenv('KUBESTRONAUT_RECEIVERS')
22+
KUBESTRONAUT_RECEIVERS = os.getenv('KUBESTRONAUT_RECEIVERS')
23+
if not KUBESTRONAUT_RECEIVERS:
24+
raise RuntimeError(
25+
"Environment variable 'KUBESTRONAUT_RECEIVERS' is not set. "
26+
"Please set it to the Google Sheets key before running this script."
27+
)
2328

2429

2530
# Let's open the GoogleSheet to write Kubestronaut info + coupons

0 commit comments

Comments
 (0)