def _save_chain(chain_pem, chain_file):
 try:
  chain_file.write(chain_pem)
 finally:
  chain_file.close()
 logger.info('Cert chain written to %s', chain_file.name)

def _save_chain ( chain_pem , chain_file ) : try : chain_file . write ( chain_pem ) finally : chain_file . close ( ) logger . info ( 'Cert chain written to %s' , chain_file . name )
saves chain_pem at a unique path based on chain_path .