def METHOD_NAME(_file, data):
    LOG.info(f"Writing cluster details to {_file}")
    with open(_file, "w") as fp:
        try:
            yaml.dump(data, fp, default_flow_style=False)
        except yaml.YAMLError:
            raise ConfigError(f"Invalid configuration file '{_file}'")