← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1310952] [NEW] Not assignment variable 'image' in api.v2.image_data

 

Public bug reported:

Raise UnboundLocalError in 'try expect' block while catching exception
using a var 'image'.

File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 393, in assertRaises
    self.assertThat(our_callable, matcher)
  File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 404, in assertThat
    mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
  File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 454, in _matchHelper
    mismatch = matcher.match(matchee)
  File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 108, in match
    mismatch = self.exception_matcher.match(exc_info)
  File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 62, in match
    mismatch = matcher.match(matchee)
  File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 385, in match
    reraise(*matchee)
  File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 101, in match
    result = matchee()
  File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 902, in __call__
    return self._callable_object(*self._args, **self._kwargs)
  File "glance/common/utils.py", line 437, in wrapped
    return func(self, req, *args, **kwargs)
  File "glance/api/v2/image_data.py", line 120, in upload
    self._restore(image_repo, image)
UnboundLocalError: local variable 'image' referenced before assignment

** Affects: glance
     Importance: Undecided
     Assignee: Sergey Nikitin (snikitin)
         Status: In Progress

** Changed in: glance
     Assignee: (unassigned) => Sergey Nikitin (snikitin)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1310952

Title:
  Not assignment variable 'image' in api.v2.image_data

Status in OpenStack Image Registry and Delivery Service (Glance):
  In Progress

Bug description:
  Raise UnboundLocalError in 'try expect' block while catching exception
  using a var 'image'.

  File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 393, in assertRaises
      self.assertThat(our_callable, matcher)
    File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 404, in assertThat
      mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
    File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 454, in _matchHelper
      mismatch = matcher.match(matchee)
    File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 108, in match
      mismatch = self.exception_matcher.match(exc_info)
    File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 62, in match
      mismatch = matcher.match(matchee)
    File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 385, in match
      reraise(*matchee)
    File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 101, in match
      result = matchee()
    File "/opt/stack/glance/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 902, in __call__
      return self._callable_object(*self._args, **self._kwargs)
    File "glance/common/utils.py", line 437, in wrapped
      return func(self, req, *args, **kwargs)
    File "glance/api/v2/image_data.py", line 120, in upload
      self._restore(image_repo, image)
  UnboundLocalError: local variable 'image' referenced before assignment

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1310952/+subscriptions


Follow ups

References