redhat-cop/infra.osbuild

start_compose will never run if `allow_duplicate` is set to `false`

jharmison-redhat opened this issue · 0 comments

Because the list is made up of several lists concatenated together (see here) inside of another list, even if all four lists are empty the outer list will always have a length of 1 (the empty list result of all the concatenation). Because of this, len(dupe_compose) will always equal 1 under all circumstances, causing this check to react as if no compose is necessary - even if no composes exist at the Weldr API at all.

If we suppose that we have potentially four empty lists for compose_queue_new_dupe, compose_queue_run_dupe, etc. the code is equivalent to this:

>>> empty_list_1 = []
>>> empty_list_2 = []
>>> empty_list_3 = []
>>> empty_list_4 = []
>>> empty_lists = [empty_list_1 + empty_list_2 + empty_list_3 + empty_list_4]
>>> empty_lists
[[]]
>>> len(empty_lists)
1