packageutils: Ensure packages argument is a list

It's easy to screw this up from the callers, and gives weird
interactions with apper
This commit is contained in:
Cole Robinson 2017-08-07 17:26:12 -04:00
parent 4cdae27cb2
commit cc72f74f97

View File

@ -38,6 +38,8 @@ def check_packagekit(parent, errbox, packages):
if not packages: if not packages:
logging.debug("No PackageKit packages to search for.") logging.debug("No PackageKit packages to search for.")
return return
if type(packages) is not list:
packages = [packages]
logging.debug("PackageKit check/install for packages=%s", packages) logging.debug("PackageKit check/install for packages=%s", packages)
try: try: