[PATCH 0/2] Fix issue #430: Properly list packages update on openSUSE systems

Also remove useless variables assignment Aline Manera (2): Delete useless variables assignment Fix issue #430: Properly list packages update on openSUSE systems src/kimchi/model/host.py | 2 -- src/kimchi/swupdate.py | 9 +++------ 2 files changed, 3 insertions(+), 8 deletions(-) -- 1.9.3

Task resource is not used on PackagesUpdate so there is no need to assign it. Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- src/kimchi/model/host.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py index 8153164..3975a10 100644 --- a/src/kimchi/model/host.py +++ b/src/kimchi/model/host.py @@ -363,8 +363,6 @@ class PackagesUpdateModel(object): self.host_swupdate = SoftwareUpdate() except: self.host_swupdate = None - self.objstore = kargs['objstore'] - self.task = TaskModel(**kargs) def get_list(self): if self.host_swupdate is None: -- 1.9.3

getPackagesList() is supposed to return a list of dictionaries in which dict represents a package to be updates in the format: {'package_name': <string>, 'version': <string>, 'arch': <string>, 'repository': <string>} But it was retuning a list of packages names that was breaking all the update logic. Fix it by returning the right data format on getPackagesList() Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- src/kimchi/swupdate.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/kimchi/swupdate.py b/src/kimchi/swupdate.py index 5b24ce0..85cdfd6 100644 --- a/src/kimchi/swupdate.py +++ b/src/kimchi/swupdate.py @@ -238,7 +238,7 @@ class ZypperUpdate(object): """ Update the list of packages to be updated in the system. """ - self._pkgs = {} + self._pkgs = [] cmd = ["zypper", "list-updates"] (stdout, stderr, returncode) = run_command(cmd) @@ -250,7 +250,7 @@ class ZypperUpdate(object): info = line.split(' | ') package = {'package_name': info[2], 'version': info[4], 'arch': info[5], 'repository': info[1]} - self._pkgs[info[2]] = package + self._pkgs.append(package) def getPackagesList(self): """ @@ -262,7 +262,4 @@ class ZypperUpdate(object): kimchiLock.acquire() self._refreshUpdateList() kimchiLock.release() - pkg_list = [] - for pkg in self._pkgs: - pkg_list.append(pkg) - return pkg_list + return self._pkgs -- 1.9.3

Reviewed-by: Daniel Barboza <danielhb@linux.vnet.ibm.com> On 09/18/2014 11:55 AM, Aline Manera wrote:
Also remove useless variables assignment
Aline Manera (2): Delete useless variables assignment Fix issue #430: Properly list packages update on openSUSE systems
src/kimchi/model/host.py | 2 -- src/kimchi/swupdate.py | 9 +++------ 2 files changed, 3 insertions(+), 8 deletions(-)
participants (2)
-
Aline Manera
-
Daniel H Barboza