#NEWLINE# def _create_job_step( self , phase , data , force_create = False , cluster = None , **defaults ) : #NEWLINE# #INDENT# "\n        Gets or creates the primary JobStep for a Jenkins Job.\n\n        Args:\n            phase (JobPhase): JobPhase the JobStep should be part of.\n            data (dict): JSON-serializable data associated with the Jenkins build.\n            force_create (bool): Force this JobStep to be created (rather than\n                retrieved). This is used when replacing a JobStep to make sure\n                we don't just get the old one.\n            cluster (Optional[str]): Cluster in which the JobStep will be run.\n        Returns:\n            JobStep: The JobStep that was retrieved or created.\n        " #NEWLINE# defaults [ 'data' ] = defaults #NEWLINE# if cluster : #NEWLINE# #INDENT# defaults [ 'cluster' ] = cluster #NEWLINE# #UNINDENT# if ( not defaults . get ( 'label' ) ) : #NEWLINE# #INDENT# defaults [ 'label' ] = '<Creating Jenkins build>' #NEWLINE# #UNINDENT# where = { #NEWLINE# #INDENT# 'job' : phase . job , #NEWLINE# 'project' : phase . project , #NEWLINE# 'phase' : phase , #NEWLINE# #UNINDENT# } #NEWLINE# if force_create : #NEWLINE# #INDENT# where [ 'id' ] = uuid . uuid4 ( ) #NEWLINE# #UNINDENT# ( step , created ) = get_or_create ( JobStep , where = where , defaults = defaults ) #NEWLINE# assert ( created or ( not force_create ) ) #NEWLINE# BuildStep . handle_debug_infra_failures ( step , self . debug_config , 'primary' ) #NEWLINE# return step