def report_writer()

in stratozone-aws-export.py [0:0]


def report_writer(dictionary_data, field_name_list, file_name, directory = './output/vm/'):
  """write data contained in dictionary list into csv file.

  Args:
    dictionary_data: dictionary object
    field_name_list: column names
    file_name: file name to be created
    directory: parent directory

  Returns:
      Dictionary object.
  """
  try:
    logging.info('Writing %s to the disk', file_name)
    with open(directory + file_name, 'w', newline='') as csvfile:
      writer = csv.DictWriter(
          csvfile, fieldnames=field_name_list, extrasaction='ignore')
      writer.writeheader()
      for dictionary_value in dictionary_data:
        writer.writerow(dictionary_value)
  except Exception as e:
    logging.error('error in report_writer')
    logging.error(e)