Skip to content

Commit

Permalink
add exception placeholder for older msgpacks
Browse files Browse the repository at this point in the history
Fix for #26705.
  • Loading branch information
jfindlay committed Aug 27, 2015
1 parent 24a4f54 commit ebcfaf9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions salt/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@
#sys.exit(salt.defaults.exitcodes.EX_GENERIC)


if not hasattr(msgpack, 'exceptions'):
class PackValueError(Exception):
'''
older versions of msgpack do not have PackValueError
'''

class exceptions(object):
'''
older versions of msgpack do not have an exceptions module
'''
PackValueError = PackValueError()

msgpack.exceptions = exceptions()


def package(payload):
'''
This method for now just wraps msgpack.dumps, but it is here so that
Expand Down

0 comments on commit ebcfaf9

Please sign in to comment.