Skip to content

Conversation

@snapshotleisure
Copy link

Adding NoneType check to fix the issue #1508. The convert_to_list is not checking for NoneType which occurs when someone is using the tdnf module to perform a update_cache or upgrade command, as this does not populate the name argument which is used to create the pkglist.

@vmwclabot
Copy link

@snapshotleisure, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@vmwclabot
Copy link

@snapshotleisure, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

@oliverkurth oliverkurth requested a review from sshedi November 13, 2023 03:45
@sshedi
Copy link
Contributor

sshedi commented Nov 13, 2023

Hi @snapshotleisure,
Yes, issue is valid and I'm willing to take a fix for this. The proposed fix works but I would prefer this version instead.

@@ -289,6 +289,9 @@
     """Convert nested list into flat list"""
     flat_list = []

+    if not input_list:
+        return flat_list
+
     for sublist in input_list:
         if not isinstance(sublist, list):
             flat_list.append(sublist)

Can you please send another patch please?

Fixing convert_to_list function to handle input None
@snapshotleisure
Copy link
Author

Hi @sshedi, no worries have tested your recommended fix and it works well, I have created pull request #1518

gerrit-photon pushed a commit that referenced this pull request Nov 14, 2023
Fixes: #1508

Original author of this fix is:
snapshotleisure <[email protected]>
#1517

Change-Id: I32f1f352dea9d33de88f57a7180cfb1ea30f4f4a
Signed-off-by: Shreenidhi Shedi <[email protected]>
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/c/photon/+/22341
Tested-by: gerrit-photon <[email protected]>
gerrit-photon pushed a commit that referenced this pull request Nov 14, 2023
Fixes: #1508

Original author of this fix is:
snapshotleisure <[email protected]>
#1517

Change-Id: I4a04f852169fa5821f6aa25cb7ed072e5bc621c3
Signed-off-by: Shreenidhi Shedi <[email protected]>
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/c/photon/+/22343
Tested-by: gerrit-photon <[email protected]>
gerrit-photon pushed a commit that referenced this pull request Nov 14, 2023
Fixes: #1508

Original author of this fix is:
snapshotleisure <[email protected]>
#1517

Change-Id: I32f1f352dea9d33de88f57a7180cfb1ea30f4f4a
Signed-off-by: Shreenidhi Shedi <[email protected]>
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/c/photon/+/22342
@vmwclabot
Copy link

@snapshotleisure, VMware has approved your signed contributor license agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants