def _UpdateKeyFiles(keys, dry_run, keyfiles):
  assert set(keyfiles) == constants.SSHK_ALL

  for (kind, private_key, public_key) in keys:
    (private_file, public_file) = keyfiles[kind]

    logging.debug("Writing %s ...", private_file)
    utils.WriteFile(private_file, data=private_key, mode=0600,
                    backup=True, dry_run=dry_run)

    logging.debug("Writing %s ...", public_file)
    utils.WriteFile(public_file, data=public_key, mode=0644,
                    backup=True, dry_run=dry_run)
Determines the HttpResponse for the add_view stage. It mostly defers to
dataset/ETHPy150Open ganeti/ganeti/lib/tools/prepare_node_join.py/_UpdateKeyFiles--crossover with--dataset/ETHPy150Open baskoopmans/djcommon/djcommon/admin.py/EnhancedModelAdmin.response_add