Merge lp:~diegosarmentero/ubuntuone-client/crazy-comma into lp:ubuntuone-client
| Status: | Merged |
|---|---|
| Approved by: | Diego Sarmentero on 2012-10-05 |
| Approved revision: | 1331 |
| Merged at revision: | 1332 |
| Proposed branch: | lp:~diegosarmentero/ubuntuone-client/crazy-comma |
| Merge into: | lp:ubuntuone-client |
| Diff against target: |
12 lines (+1/-1) 1 file modified
ubuntuone/platform/tools/__init__.py (+1/-1) |
| To merge this branch: | bzr merge lp:~diegosarmentero/ubuntuone-client/crazy-comma |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Mike McCracken (community) | Approve on 2012-10-05 | ||
| Brian Curtin (community) | 2012-10-04 | Approve on 2012-10-04 | |
|
Review via email:
|
|||
Commit Message
- The comma was misplaced.
| Natalia Bidart (nataliabidart) wrote : | # |
Completely agreed with Mike, the comma is correct (though I agree we could improve the readability of the code).
The deferred's result is expected to be a tuple, in all cases (within this module). What error were you trying to solve?
Thanks.
- 1331. By Diego Sarmentero on 2012-10-05
-
adding comment
| Diego Sarmentero (diegosarmentero) wrote : | # |
> The corresponding test fails for me on linux:
>
> [ERROR]
> Traceback (most recent call last):
> File "/usr/lib/
> 1039, in _inlineCallbacks
> result = g.send(result)
> File "/home/
> comma/tests/
> self.assertEqua
> exceptions.
>
> tests.platform.
>
>
> I'm also not sure this is the best way to fix this. It's not inconsistent - 8
> other places in this file unpack their result like this. Why do they do that?
> (Their return value isn't used anywhere I could find, but I wasn't sure I was
> testing libsyncdaemon correctly, so it might be used there, or in other
> clients of this code.) Either we should change them all or leave this in and
> change the calling code, but without knowing the reason I really don't want to
> make them inconsistent.
>
> The code that uses this return value over in ubuntuone-
> just fine if you use the return value directly, eg - when you do:
> result=yield self.backend.
> then do this:
> _load_public_
> instead of this:
> _load_public_
>
> and the control-panel tests pass with that change.
>
> Disapprove seems harsh, but I'm just not convinced that this change is
> necessary, or that we completely understand whether it breaks anything…
adding a comment specifying the need of the comma, and fixed the u1-cp part


The corresponding test fails for me on linux:
[ERROR] python2. 7/dist- packages/ twisted/ internet/ defer.py" , line 1039, in _inlineCallbacks mmccrack/ Documents/ src/crazy- comma/tests/ platform/ test_tools. py", line 753, in test_get_ public_ files assertEqual( pf['node_ id'], node_id) TypeError: list indices must be integers, not str
Traceback (most recent call last):
File "/usr/lib/
result = g.send(result)
File "/home/
self.
exceptions.
tests.platform. test_tools. TestToolsSomeMo re.test_ get_public_ files
I'm also not sure this is the best way to fix this. It's not inconsistent - 8 other places in this file unpack their result like this. Why do they do that? (Their return value isn't used anywhere I could find, but I wasn't sure I was testing libsyncdaemon correctly, so it might be used there, or in other clients of this code.) Either we should change them all or leave this in and change the calling code, but without knowing the reason I really don't want to make them inconsistent.
The code that uses this return value over in ubuntuone- control- panel works just fine if you use the return value directly, eg - when you do: get_public_ files() files(result) files(result[ 0])
result=yield self.backend.
then do this:
_load_public_
instead of this:
_load_public_
and the control-panel tests pass with that change.
Disapprove seems harsh, but I'm just not convinced that this change is necessary, or that we completely understand whether it breaks anything…