On Sun, May 03, 2009 at 12:24:34PM -0300, Leandro Lucarella wrote:
> Package: unattended-upgrades
> Version: 0.39debian1
> Severity: normal
> 
>
> When cron executes unatteded-upgrde I get this messages:
> 
> /usr/bin/unattended-upgrade:40: DeprecationWarning: Accessed deprecated 
> property Package.candidateOrigin, please see the Version class for 
> alternatives.
>   if not pkg.candidateOrigin:
> /usr/bin/unattended-upgrade:42: DeprecationWarning: Accessed deprecated 
> property Package.candidateOrigin, please see the Version class for 
> alternatives.
>   for origin in pkg.candidateOrigin:
[..]

Thanks for your bugreport.

Please try the attached patch.

Thanks,
 Michael
=== modified file 'unattended-upgrade'
--- unattended-upgrade	2009-03-02 09:40:16 +0000
+++ unattended-upgrade	2009-05-05 17:37:58 +0000
@@ -37,9 +37,9 @@
         
 
 def is_allowed_origin(pkg, allowed_origins):
-    if not pkg.candidateOrigin:
+    if not pkg.candidate:
         return False
-    for origin in pkg.candidateOrigin:
+    for origin in pkg.candidate.origins:
         for allowed in allowed_origins:
             if origin.origin == allowed[0] and origin.archive == allowed[1]:
                 return True
@@ -187,7 +187,7 @@
     pkgs_kept_back = []
     for pkg in cache:
         if options.debug and pkg.isUpgradable:
-            logging.debug("Checking: %s (%s)" % (pkg.name,map(str, pkg.candidateOrigin)))
+            logging.debug("Checking: %s (%s)" % (pkg.name, map(str, pkg.candidate.origins)))
         if (pkg.isUpgradable and 
 	    is_allowed_origin(pkg,allowed_origins)):
             try:

Reply via email to