Opened 14 years ago
Closed 14 years ago
#666 closed defect (fixed)
AttributeError: 'NoneType' object has no attribute 'active'
Reported by: | eblot | Owned by: | osimons |
---|---|---|---|
Priority: | major | Milestone: | 0.6 |
Component: | Build master | Version: | dev |
Keywords: | Cc: | ||
Operating System: | BSD |
Description
When restarting a test session, the following traceback appears many times:
Traceback (most recent call last): File "/local/engine/trac/trac/web/main.py", line 511, in _dispatch_request dispatcher.dispatch(req) File "/local/engine/trac/trac/web/main.py", line 237, in dispatch resp = chosen_handler.process_request(req) File "/local/engine/bitten/bitten/master.py", line 107, in process_request return self._process_build_creation(req, slave_token) File "/local/engine/bitten/bitten/master.py", line 218, in _process_build_creation build = queue.get_build_for_slave(slavename, properties) File "/local/engine/bitten/bitten/queue.py", line 145, in get_build_for_slave if self.should_delete_build(build, repos): File "/local/engine/bitten/bitten/queue.py", line 322, in should_delete_build if not config.active: AttributeError: 'NoneType' object has no attribute 'active'
Looking at the code, it seems that the culprit method is should_delete_build():
- trunk/bitten/model.py#L149 may return None, whereas
- trunk/bitten/queue.py#L307 dereference the config instance without testing for the None condition
Attachments (0)
Change History (4)
comment:1 follow-up: ↓ 2 Changed 14 years ago by osimons
- Milestone changed from 0.6.1 to 0.6
- Owner set to osimons
comment:2 in reply to: ↑ 1 Changed 14 years ago by eblot
Replying to osimons:
So, just something like this should then be enough
Yes, I wrote my own patch the other way around (if not config or not config.active:), no more exceptions since.
comment:3 Changed 14 years ago by osimons
I just spotted the subsequent logging of config.name, which may not work so well if config is None... A unittest would be quite useful to find and keep track of any pitfalls here.
comment:4 Changed 14 years ago by osimons
- Resolution set to fixed
- Status changed from new to closed
Fixed in [972:973]. Thanks Emmanuel.
So, just something like this should then be enough:
bitten/queue.py
config.active:Makes sense. If the config is gone, then so should the build.