Merge pull request #26714 from jfindlay/pack_except

add exception placeholder for older msgpacks
This commit is contained in:
Colton Myers 2015-08-28 10:02:35 -06:00
commit 16d4e0350d

View File

@ -48,6 +48,21 @@ except ImportError:
#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