AttributeError: 'Entry' object has no attribute 'bug_tasks'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Svammel (UNMAINTAINED) |
Fix Released
|
Undecided
|
Ricardo Salveti |
Bug Description
INFO:Svammel:
DEBUG:Svammel:
DEBUG:Svammel:Done getting 'Successfully built' builds for source 'kdeutils'
Traceback (most recent call last):
File "file-failures.py", line 176, in <module>
for bug_task in bug.bug_tasks:
File "/usr/lib/
return super(Entry, self)._
File "/usr/lib/
% (self._
AttributeError: 'Entry' object has no attribute 'bug_tasks'
When running svammel with a proper log file, and running with --dryrun it'll raise this exception when trying go to over the bug tasks:
bug = get_launchpad(
for bug_task in bug.bug_tasks:
As the log already points a bug task (e.g. https:/
While writing the log:
bug_log.
So a simple patch should fix this issue, like:
$ bzr diff
=== modified file 'file-failures.py'
--- file-failures.py 2011-04-26 12:57:19 +0000
+++ file-failures.py 2011-06-02 01:55:37 +0000
@@ -172,8 +172,7 @@
else:
- bug = get_launchpad(
- for bug_task in bug.bug_tasks:
- logger.info("Had reason to close the bugtask %s but " \
+ bug_task = get_launchpad(
+ logger.info("Had reason to close the bugtask %s but " \
Changed in svammel: | |
assignee: | nobody → Ricardo Salveti (rsalveti) |
milestone: | none → 0.1.2 |
status: | New → Fix Committed |
Changed in svammel: | |
status: | Fix Committed → Fix Released |
On Thu, Jun 2, 2011 at 3:55 AM, Ricardo Salveti <email address hidden> wrote: Checking for successful builds for package kdeutils version >= 4:4.6.3-1ubuntu1 Getting 'Successfully built' builds for source 'kdeutils' from archive 'oneiric' python2. 7/dist- packages/ lazr/restfulcli ent/resource. py", line 673, in __getattr__ _getattr_ _(name) python2. 7/dist- packages/ lazr/restfulcli ent/resource. py", line 319, in __getattr__ _class_ _.__name_ _, attr)) ).load( log_entry. bugtask_ url) /api.launchpad. net/1.0/ ubuntu/ +source/ emacs23/ +bug/791297), the
> Public bug reported:
>
> INFO:Svammel:
> DEBUG:Svammel:
> DEBUG:Svammel:Done getting 'Successfully built' builds for source 'kdeutils'
> Traceback (most recent call last):
> File "file-failures.py", line 176, in <module>
> for bug_task in bug.bug_tasks:
> File "/usr/lib/
> return super(Entry, self)._
> File "/usr/lib/
> % (self._
> AttributeError: 'Entry' object has no attribute 'bug_tasks'
>
> When running svammel with a proper log file, and running with --dryrun it'll raise this exception when trying go to over the bug tasks:
> bug = get_launchpad(
> for bug_task in bug.bug_tasks:
> logger.info("Had reason to close the bugtask %s but " \
> "didn't since dryrun is specified." % \
> bug_task.web_link)
>
> As the log already points a bug task (e.g.
> https:/
> object will in the end also be a bug task instead of a bug (where you
> can then iterate over the bug_tasks).
Yes, that's some code that I forgot to change when switching to
logging the bug tasks instead of the bug url:s.
> write_entry( LogEntry( spph.package_ name, spph.version, fail_platform, bug.bug_ tasks[0] .self_link) .to_string( )) by_url( log_entry. bugtask_ url, new_status, ).load( log_entry. bugtask_ url) ).load( log_entry. bugtask_ url)
> While writing the log:
> bug_log.
>
> So a simple patch should fix this issue, like:
> $ bzr diff
> === modified file 'file-failures.py'
> --- file-failures.py 2011-04-26 12:57:19 +0000
> +++ file-failures.py 2011-06-02 01:55:37 +0000
> @@ -172,8 +172,7 @@
> close_bug_
> get_launchpad())
> else:
> - bug = get_launchpad(
> - for bug_task in bug.bug_tasks:
> - logger.info("Had reason to close the bugtask %s but " \
> + bug_task = get_launchpad(
> + logger.info("Had reason to close the bugtask %s but " \
> "didn't since dryrun is specified." % \
> bug_task.web_link)
Thanks! That should do the trick. I couldn't run the script against
the qastaging environment atm due to time-outs. If you can verify with
your production bug logs, I'd be happy.
lp:~mabac/svammel/two-small-fixes
Thanks,
Mattias