@@ -19,7 +19,8 @@ from mas.devops.slack import SlackUtil
1919def notifyProvisionFyre (rc : int ) -> bool :
2020 name = os .getenv ("CLUSTER_NAME" , None )
2121 if name is None :
22- print ("CLUSTER_NAME env var must all be set" )
22+ print ("CLUSTER_NAME env var must be set" )
23+ sys .exit (1 )
2324
2425 if rc == 0 :
2526 url = os .getenv ("OCP_CLUSTER_URL" , None )
@@ -28,15 +29,17 @@ def notifyProvisionFyre(rc: int) -> bool:
2829
2930 if url is None or username is None or password is None :
3031 print ("OCP_CLUSTER_URL, OCP_USERNAME, and OCP_PASSWORD env vars must all be set" )
32+ sys .exit (1 )
3133
3234 message = [
33- SlackUtil .buildSection (f":glyph-ok: *Your IBM DevIT Fyre OCP cluster ({ name } ) is ready to use *" ),
35+ SlackUtil .buildSection (f":glyph-ok: *Your IBM DevIT Fyre OCP cluster ({ name } ) is ready*" ),
3436 SlackUtil .buildSection (f"{ url } " ),
3537 SlackUtil .buildSection (f"- Username: `{ username } `\n - Password: `{ password } `" )
3638 ]
3739 else :
3840 message = [
3941 SlackUtil .buildSection (f":glyph-fail: *Your IBM DevIT Fyre OCP cluster ({ name } ) failed to deploy*" ),
42+ SlackUtil .buildSection ("https://beta.fyre.ibm.com/development/vms" )
4043 ]
4144
4245 response = SlackUtil .postMessageBlocks ("#bot-test" , message )
@@ -45,6 +48,7 @@ def notifyProvisionFyre(rc: int) -> bool:
4548
4649
4750if __name__ == "__main__" :
51+ # If SLACK_TOKEN env var is not set then silently exit taking no action
4852 SLACK_TOKEN = os .getenv ("SLACK_TOKEN" , None )
4953 if SLACK_TOKEN is None :
5054 sys .exit (0 )
0 commit comments