Bug #9118

[SDK] arv-put unbound variable 'output' after exception from API server

Added by Peter Amstutz about 5 years ago. Updated about 5 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Brett Smith
Category:
-
Target version:
Start date:
05/02/2016
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-

Description

When the API server raises an error, arv-put fails with UnboundLocalError: local variable 'output' referenced before assignment:

arv-put: Error creating Collection on project: <HttpError 422 when requesting https://gcam1.example.com/arvados/v1/collections?ensure_unique_name=true&alt=json returned "#<NoMemoryError: failed to allocate memory>">.
Traceback (most recent call last):
 File "/usr/local/bin/arv-put", line 4, in <module>
   main()
 File "/usr/local/lib/python2.7/dist-packages/arvados/commands/put.py", line 533, in main
   stdout.write(output)
UnboundLocalError: local variable 'output' referenced before assignment

Subtasks

Task #9127: Review 9118-arv-put-nameerror-fix-wipResolvedBrett Smith

Associated revisions

Revision 96aad215
Added by Brett Smith about 5 years ago

Merge branch '9118-arv-put-nameerror-fix-wip'

Closes #9118, #9127.

History

#1 Updated by Peter Amstutz about 5 years ago

  • Description updated (diff)

#2 Updated by Brett Smith about 5 years ago

  • Status changed from New to In Progress
  • Assigned To set to Brett Smith
  • Target version set to 2016-05-11 sprint

#3 Updated by Peter Amstutz about 5 years ago

@ e365fa2

Is there a particular reason to catch NameException instead of something like:

output = None
...
if output is not None:
   ...
else:
  status = status or 1

#4 Updated by Brett Smith about 5 years ago

Peter Amstutz wrote:

Is there a particular reason to catch NameException instead of something like:

No.

#5 Updated by Brett Smith about 5 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:96aad215edcc0f314216c07df9246799665dd19d.

Also available in: Atom PDF