AnsweredAssumed Answered

suppress certificate warning

Question asked by fallingdog on Sep 22, 2018
Latest reply on Sep 25, 2018 by JQuinn-esristaff

I have a python scrip that uploads a service definition file to a server. When I run the code I get the below message. 

Is there a way to suppress this? I would like to run the python script as a batch job with task manager... it looks like when it hits this it just hangs. I have a sever connection file that uses http.

 

import arcpy
import os

loc_path = r"\\xxx\CW_Composite.loc"
out_sddraft = r"\\xxx\cw_xsys_geocoder.sddraft"
service_name = "CW_Composite_xsys_py"
server_type = "FROM_CONNECTION_FILE"
connection_file_path = r"\\xxx\ceav456_admin.ags"
copy_data_to_server = True
folder_name = "Locators"
supported_operations = ["GEOCODE", "REVERSE_GEOCODE"]

out_sd = r"\\xxx\cw_xsys_geocoder.sd"


def delete_file(sd_file):
    if os.path.isfile(sd_file):
        os.remove(sd_file)


delete_file(out_sddraft)
delete_file(out_sd)

print "Create sddraft"
analyze_message = arcpy.CreateGeocodeSDDraft(loc_path=loc_path,
                                             out_sddraft=out_sddraft,
                                             service_name=service_name,
                                             server_type=server_type,
                                             connection_file_path=connection_file_path,
                                             copy_data_to_server=copy_data_to_server,
                                             supported_operations=supported_operations,
                                             folder_name=folder_name)

if analyze_message["errors"] == {}:
    print "Create sd file"
    arcpy.server.StageService(out_sddraft, out_sd)
    print "Upload service"
    arcpy.server.UploadServiceDefinition(out_sd, connection_file_path)

print "Done!"

Outcomes