[Kimchi-devel] [PATCH] Fix content of the SW update list after disable a repository.

Aline Manera alinefm at linux.vnet.ibm.com
Tue Apr 1 19:03:43 UTC 2014


On 04/01/2014 04:01 PM, Aline Manera wrote:
> On 03/31/2014 05:05 PM, Paulo Vital wrote:
>> Kimchi lists all RPM packages to be updated when the Host tab is
>> selected, but even after disable some YUM repository and refresh the
>> content of this tab, the previous packages from the disabled repository
>> are still present in list.
>>
>> This patch "deletes" the YumBase object after get the list of packages
>> to be updated. With this, every time the Host tab is selected, a new
>> list will be generated.
>>
>> Signed-off-by: Paulo Vital <pvital at linux.vnet.ibm.com>
>> ---
>>   src/kimchi/swupdate.py | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/src/kimchi/swupdate.py b/src/kimchi/swupdate.py
>> index 23e3ff0..a785207 100644
>> --- a/src/kimchi/swupdate.py
>> +++ b/src/kimchi/swupdate.py
>> @@ -154,6 +154,7 @@ class YumUpdate(object):
>>               yb.doLock()
>>               self._pkgs = yb.doPackageLists('updates')
>>               yb.doUnlock()
>> +            del yb
>
> yb is a local variable - it should be auto-deleted when exiting the 
> function.
> If yum does not clean it we need to do that manually in all yum uses.

Also suggest to import the YumBase once (in __init__()) and instantiate 
it when needed:

swupdate.__init__

yb = getattr(__import__('yum'), 'YumBase')

swupdate._refreshUpdateList()

base = yb()


>
>>           except Exception, e:
>>               kimchiLock.release()
>>               raise OperationFailed('KCHPKGUPD0003E', {'err': str(e)})
>
> _______________________________________________
> Kimchi-devel mailing list
> Kimchi-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>




More information about the Kimchi-devel mailing list