def _write_cert_to_database(ca_name, cert, cacert_path=None, status='V'):
 set_ca_path(cacert_path)
 ca_dir = '{0}/{1}'.format(cert_base_path(), ca_name)
 (index_file, expire_date, serial_number, subject) = _get_basic_info(ca_name, cert, ca_dir)
 index_data = '{0} DCTB {1} DCTB  DCTB {2} DCTB unknown DCTB {3}'.format(status, expire_date, serial_number, subject)
 with salt.utils.fopen(index_file, 'a+') as ofile:
  ofile.write(index_data)

def _write_cert_to_database ( ca_name , cert , cacert_path = None , status = 'V' ) : set_ca_path ( cacert_path ) ca_dir = '{0}/{1}' . format ( cert_base_path ( ) , ca_name ) ( index_file , expire_date , serial_number , subject ) = _get_basic_info ( ca_name , cert , ca_dir ) index_data = '{0} DCTB {1} DCTB  DCTB {2} DCTB unknown DCTB {3}' . format ( status , expire_date , serial_number , subject ) with salt . utils . fopen ( index_file , 'a+' ) as ofile : ofile . write ( index_data )
write out the index .