add exception placeholder for older msgpacks

Fix for #26705.
This commit is contained in:
Justin Findlay 2015-08-27 13:16:55 -06:00
parent 24a4f54f39
commit ebcfaf9050

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