← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1481274] [NEW] variable referenced before assignment error in keystone.contrib.federation.idp._sign_assertion

 

Public bug reported:

The _sign_assertion() function from keystone.contrib.federation.idp
assigns file_path variable in the try block and then tries to clean up
the file in the finally block.

However, if fileutils.write_to_tempfile call raises then file_path is
not assigned that results in UnboundLocalError:

      File "keystone/contrib/federation/idp.py", line 437, in _sign_assertion
        os.remove(file_path)
    UnboundLocalError: local variable 'file_path' referenced before assignment

** Affects: keystone
     Importance: Undecided
     Assignee: Roman Bogorodskiy (novel)
         Status: In Progress

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

Title:
  variable referenced before assignment error in
  keystone.contrib.federation.idp._sign_assertion

Status in Keystone:
  In Progress

Bug description:
  The _sign_assertion() function from keystone.contrib.federation.idp
  assigns file_path variable in the try block and then tries to clean up
  the file in the finally block.

  However, if fileutils.write_to_tempfile call raises then file_path is
  not assigned that results in UnboundLocalError:

        File "keystone/contrib/federation/idp.py", line 437, in _sign_assertion
          os.remove(file_path)
      UnboundLocalError: local variable 'file_path' referenced before assignment

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


Follow ups