def _get_snapshot_dir(opts: _NspawnOpts, plugin_args: NspawnPluginArgs):
    if ((plugin_args.attach_antlir_dir != AttachAntlirDirMode.OFF) and (not opts.layer.path(ANTLIR_DIR).exists()) and opts.subvolume_on_disk and opts.subvolume_on_disk.build_appliance_path):
        return (opts.subvolume_on_disk.build_appliance_path / RPM_DEFAULT_SNAPSHOT_FOR_INSTALLER_DIR.strip_leading_slashes())
    if (plugin_args.attach_antlir_dir == AttachAntlirDirMode.EXPLICIT_ON):
        raise AttachAntlirDirError('ERROR: Could not attach antlir dir. Pleasecheck to make sure that you do not have an existing antlir directory in your image and that the image has a discoverable build appliance (usually through its flavor).')
    return opts.layer.path(RPM_DEFAULT_SNAPSHOT_FOR_INSTALLER_DIR)
def _get_snapshot_dir(opts: _NspawnOpts, plugin_args: NspawnPluginArgs):
    if ((plugin_args.attach_antlir_dir != AttachAntlirDirMode.OFF) and (not opts.layer.path(ANTLIR_DIR).exists()) and opts.subvolume_on_disk and opts.subvolume_on_disk.build_appliance_path):
        return (opts.subvolume_on_disk.build_appliance_path / RPM_DEFAULT_SNAPSHOT_FOR_INSTALLER_DIR.strip_leading_slashes())
    if (plugin_args.attach_antlir_dir == AttachAntlirDirMode.EXPLICIT_ON):
        raise AttachAntlirDirError('ERROR: Could not attach antlir dir. Pleasecheck to make sure that you do not have an existing antlir directory in your image and that the image has a discoverable build appliance (usually through its flavor).')
    return opts.layer.path(RPM_DEFAULT_SNAPSHOT_FOR_INSTALLER_DIR)