Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Fix pickle error with HPOneViewException #321

Closed
wants to merge 1 commit into from

Conversation

eamonnotoole
Copy link
Contributor

This commit fixes #320.

The problem seems to be that when oneview_response is not None the
Exception base class is called with two arguments whereas
HPOneViewException is defined to have one argument. A simple fix is to
append self.oneview_response to self.msg and pass call Exception with
just self.msg

Description

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve. e.g., Fixes #1]

Check List

  • New functionality includes testing.
    • All tests pass for Python 2.7+ & 3.4+($ tox).
  • New functionality has been documented in the README if applicable.
    • New functionality has been thoroughly documented in the examples (please include helpful comments).
  • Changes are documented in the CHANGELOG.

@eamonnotoole eamonnotoole force-pushed the fix-pickle branch 4 times, most recently from 3216792 to 5e5c071 Compare October 3, 2017 07:43
This commit fixes HewlettPackard#320.

The problem seems to be that when oneview_response is not None the
Exception base class is called with two arguments whereas
HPOneViewException is defined to have one argument.  This fix overrides
the __reduce__ method so that pickle will recognise the situation where
two arguments are used.
AnushaY1916 pushed a commit that referenced this pull request Mar 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seeing EncodingError with HPOneViewException (unable to pickle class Backup - Error in settings.py
1 participant