Skip to content

Commit ac9ff49

Browse files
committed
handle unverified CAS connections
1 parent 2ea0b09 commit ac9ff49

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/sasctl/tasks.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import logging
1111
import math
1212
import pickle
13+
import os
1314
import re
1415
import sys
1516
import warnings
@@ -535,6 +536,14 @@ def update_model_performance(data, model, label, refresh=True):
535536
regex = r'{}_(\d)_.*_{}'.format(table_prefix,
536537
model_obj.id)
537538

539+
# Save the current setting before overwriting
540+
orig_sslreqcert = os.environ.get('SSLREQCERT')
541+
542+
# If SSL connections to microservices are not being verified, don't attempt
543+
# to verify connections to CAS - most likely certs are not in place.
544+
if not sess.verify:
545+
os.environ['SSLREQCERT'] = 'no'
546+
538547
# Upload the performance data to CAS
539548
with swat.CAS(url,
540549
username=sess.username,
@@ -571,6 +580,10 @@ def update_model_performance(data, model, label, refresh=True):
571580
caslib=caslib,
572581
promote=True)).casTable
573582

583+
# Restore the original value
584+
if orig_sslreqcert is not None:
585+
os.environ['SSLREQCERT'] = orig_sslreqcert
586+
574587
# Execute the definition if requested
575588
if refresh:
576589
mm.execute_performance_definition(perf_def)

0 commit comments

Comments
 (0)