Skip to content

Commit 49b99b2

Browse files
committed
[patch] Handle env vars set to empty string
1 parent 1334c1a commit 49b99b2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

bin/mas-devops-notify-slack

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def notifyProvisionFyre(channel: str, rc: int) -> bool:
5656

5757
if __name__ == "__main__":
5858
# If SLACK_TOKEN or SLACK_CHANNEL env vars are not set then silently exit taking no action
59-
SLACK_TOKEN = os.getenv("SLACK_TOKEN", None)
60-
SLACK_CHANNEL = os.getenv("SLACK_CHANNEL", None)
61-
if SLACK_TOKEN is None or SLACK_CHANNEL is None:
59+
SLACK_TOKEN = os.getenv("SLACK_TOKEN", "")
60+
SLACK_CHANNEL = os.getenv("SLACK_CHANNEL", "")
61+
if SLACK_TOKEN == "" or SLACK_CHANNEL == "":
6262
sys.exit(0)
6363

6464
# Initialize the properties we need

0 commit comments

Comments
 (0)