This is follow-up of https://pagure.io/freshmaker/pull-request/388.
In that PR, we fixed deduplication code for case when image changed
its parent image completely within the same version but different
release.
The issue is that this works only when lightblue_released_dependencies_only
is set to False. In case it is set to True, the latest_released_nvr_index
is set to -1 indicating that the deduplication code should replace all
the images with latest release version (so in case the image is released
but based on the unreleased image, we move it back to released release
of that parent image).
When latest_released_nvr_index is -1, the current code to set latest_image
is simply broken, because it does latest_image = nvr_to_image[nvrs[latest_released_nvr_index]]
and therefore effectively sets the latest_image to the oldest image (nvrs[-1]).
This commit fixes this issue.
It also removes n_to_nvs which is not used anymore and one try/except
block which has been forgotten there from times when n_to_nvs was used.
This is follow-up of https://pagure.io/freshmaker/pull-request/388.
In that PR, we fixed deduplication code for case when image changed
its parent image completely within the same version but different
release.
The issue is that this works only when lightblue_released_dependencies_only
is set to False. In case it is set to True, the latest_released_nvr_index
is set to -1 indicating that the deduplication code should replace all
the images with latest release version (so in case the image is released
but based on the unreleased image, we move it back to released release
of that parent image).
When latest_released_nvr_index is -1, the current code to set latest_image
is simply broken, because it does
latest_image = nvr_to_image[nvrs[latest_released_nvr_index]]and therefore effectively sets the latest_image to the oldest image (
nvrs[-1]).This commit fixes this issue.
It also removes
n_to_nvswhich is not used anymore and one try/exceptblock which has been forgotten there from times when
n_to_nvswas used.