From 979123bf61a446feb9be4b55531e28cc5c60dbba Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sat, 13 Jan 2018 23:01:29 +0100 Subject: [PATCH] [fix] other part of the code didn't expected this new datastructure --- src/yunohost/utils/packages.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/yunohost/utils/packages.py b/src/yunohost/utils/packages.py index 7df31140..d19e6d77 100644 --- a/src/yunohost/utils/packages.py +++ b/src/yunohost/utils/packages.py @@ -431,12 +431,15 @@ def get_installed_version(*pkgnames, **kwargs): raise UninstalledPackage(pkgname) repo = "" - versions[pkgname] = { - "version": version, - # when we don't have component it's because it's from a local - # install or from an image (like in vagrant) - "repo": repo if repo else "local", - } + if as_dict: + versions[pkgname] = { + "version": version, + # when we don't have component it's because it's from a local + # install or from an image (like in vagrant) + "repo": repo if repo else "local", + } + else: + versions[pkgname] = version if len(pkgnames) == 1 and not as_dict: return versions[pkgnames[0]] @@ -458,4 +461,5 @@ def ynh_packages_version(*args, **kwargs): """Return the version of each YunoHost package""" return get_installed_version( 'yunohost', 'yunohost-admin', 'moulinette', 'ssowat', + as_dict=True )