#1255 closed defect (fixed)

'tahoe mv' doesn't report errors from the DELETE operation

Reported by: davidsarah Owned by: david-sarah@…
Priority: major Milestone: 1.8.1
Component: code-frontend-cli Version: 1.8.0
Keywords: tahoe-mv error review-needed Cc:
Launchpad Bug:

Description

While fixing #1253, I found another bug. src/allmydata/scripts/tahoe_mv.py@4811#L65 intends to check the status code from the DELETE operation, but actually checks the status code that is left in the status variable from the previous PUT operation. That would cause it to print 'OK' even though the DELETE has failed (in which case the source link might be left in place).

Attachments (2)

look-at-the-right-status-code.darcs.patch (16.3 KB) - added by davidsarah at 2010-11-10T01:37:28Z.
tahoe_mv.py: when checking success of the DELETE operation, look at the status code from DELETE rather than from the previous PUT. fixes #1255
test-1255.darcs.patch (19.1 KB) - added by davidsarah at 2010-11-12T02:15:00Z.
test_cli.py: test that 'tahoe mv' reports errors from the DELETE operation. refs #1255

Download all attachments as: .zip

Change History (7)

Changed at 2010-11-10T01:37:28Z by davidsarah

tahoe_mv.py: when checking success of the DELETE operation, look at the status code from DELETE rather than from the previous PUT. fixes #1255

comment:1 follow-up: Changed at 2010-11-10T04:16:43Z by davidsarah

In order to test this, we need to arrange for the DELETE to fail, but for the preceding GET and PUT to succeed. Tricky. Can anyone see how to do that reliably?

comment:2 in reply to: ↑ 1 Changed at 2010-11-10T06:59:24Z by zooko

Replying to davidsarah:

In order to test this, we need to arrange for the DELETE to fail, but for the preceding GET and PUT to succeed. Tricky. Can anyone see how to do that reliably?

How about put a fake do_http(). The fake one could check whether its first arg is "DELETE" and if so return a non-200 status code.

Changed at 2010-11-12T02:15:00Z by davidsarah

test_cli.py: test that 'tahoe mv' reports errors from the DELETE operation. refs #1255

comment:3 Changed at 2010-11-12T02:15:29Z by davidsarah

  • Keywords review-needed added; test-needed removed

comment:4 Changed at 2010-11-20T07:40:43Z by david-sarah@…

In fdf69466699f0b2b:

test_cli.py: test that 'tahoe mv' reports errors from the DELETE operation. refs #1255

comment:5 Changed at 2010-11-20T07:40:44Z by david-sarah@…

  • Owner set to david-sarah@…
  • Resolution set to fixed
  • Status changed from new to closed

In 38a0d3f5fa5a4d60:

tahoe_mv.py: when checking success of the DELETE operation, look at the status code from DELETE rather than from the previous PUT. fixes #1255

Note: See TracTickets for help on using tickets.