diff --git a/lower-constraints.txt b/lower-constraints.txt index 69740375f..6be37b5a9 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -16,7 +16,7 @@ jsonschema==2.6.0 keystoneauth1==3.4.0 keystonemiddleware==4.17.0 mock==2.0.0 -msgpack==0.5.1 +msgpack==1.0.0 os-api-ref==1.4.0 os-client-config==1.28.0 os-testr==1.0.0 diff --git a/requirements.txt b/requirements.txt index 4a7a297ca..4e2e55ec0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ falcon>=1.1.0 # Apache-2.0 jsonschema>=2.6.0 # MIT iso8601>=0.1.11 # MIT keystonemiddleware>=4.17.0 # Apache-2.0 -msgpack>=0.5.1 # Apache-2.0 +msgpack>=1.0.0 # Apache-2.0 python-memcached>=1.56 # PSF python-swiftclient>=3.2.0 # Apache-2.0 WebOb>=1.7.1 # MIT diff --git a/zaqar/common/decorators.py b/zaqar/common/decorators.py index 660bc0e7d..cfab3e6ab 100644 --- a/zaqar/common/decorators.py +++ b/zaqar/common/decorators.py @@ -148,7 +148,7 @@ def caches(keygen, ttl, cond=None): else: # NOTE(kgriffs): unpackb does not default to UTF-8, # so we have to explicitly ask for it. - value = msgpack.unpackb(packed_value, encoding='utf-8') + value = msgpack.unpackb(packed_value) return value diff --git a/zaqar/storage/redis/claims.py b/zaqar/storage/redis/claims.py index 09b2934fb..b92d97f95 100644 --- a/zaqar/storage/redis/claims.py +++ b/zaqar/storage/redis/claims.py @@ -85,9 +85,8 @@ class ClaimController(storage.Claim, scripting.Mixin): super(ClaimController, self).__init__(*args, **kwargs) self._client = self.driver.connection - self._packer = msgpack.Packer(encoding='utf-8', - use_bin_type=True).pack - self._unpacker = functools.partial(msgpack.unpackb, encoding='utf-8') + self._packer = msgpack.Packer(use_bin_type=True).pack + self._unpacker = functools.partial(msgpack.unpackb) @decorators.lazy_property(write=False) def _queue_ctrl(self): diff --git a/zaqar/storage/redis/flavors.py b/zaqar/storage/redis/flavors.py index 669edc4d6..81164fd73 100644 --- a/zaqar/storage/redis/flavors.py +++ b/zaqar/storage/redis/flavors.py @@ -69,9 +69,8 @@ class FlavorsController(base.FlavorsBase): def __init__(self, *args, **kwargs): super(FlavorsController, self).__init__(*args, **kwargs) self._client = self.driver.connection - self._packer = msgpack.Packer(encoding='utf-8', - use_bin_type=True).pack - self._unpacker = functools.partial(msgpack.unpackb, encoding='utf-8') + self._packer = msgpack.Packer(use_bin_type=True).pack + self._unpacker = functools.partial(msgpack.unpackb) @utils.raises_conn_error def list(self, project=None, marker=None, limit=10, detailed=False): diff --git a/zaqar/storage/redis/models.py b/zaqar/storage/redis/models.py index 6160b0942..666d2b741 100644 --- a/zaqar/storage/redis/models.py +++ b/zaqar/storage/redis/models.py @@ -250,8 +250,8 @@ class Message(MessageEnvelope): # ========================================================================== -_pack = msgpack.Packer(encoding='utf-8', use_bin_type=True).pack -_unpack = functools.partial(msgpack.unpackb, encoding='utf-8') +_pack = msgpack.Packer(use_bin_type=True).pack +_unpack = functools.partial(msgpack.unpackb) def _hmap_kv_to_msgenv(keys, values): diff --git a/zaqar/storage/redis/pools.py b/zaqar/storage/redis/pools.py index b51e2b523..b425bfe99 100644 --- a/zaqar/storage/redis/pools.py +++ b/zaqar/storage/redis/pools.py @@ -87,9 +87,8 @@ class PoolsController(base.PoolsBase): super(PoolsController, self).__init__(*args, **kwargs) self._client = self.driver.connection self.flavor_ctl = self.driver.flavors_controller - self._packer = msgpack.Packer(encoding='utf-8', - use_bin_type=True).pack - self._unpacker = functools.partial(msgpack.unpackb, encoding='utf-8') + self._packer = msgpack.Packer(use_bin_type=True).pack + self._unpacker = functools.partial(msgpack.unpackb) @utils.raises_conn_error @utils.retries_on_connection_error diff --git a/zaqar/storage/redis/queues.py b/zaqar/storage/redis/queues.py index 67fbdda4b..493c08d1c 100644 --- a/zaqar/storage/redis/queues.py +++ b/zaqar/storage/redis/queues.py @@ -63,9 +63,8 @@ class QueueController(storage.Queue): def __init__(self, *args, **kwargs): super(QueueController, self).__init__(*args, **kwargs) self._client = self.driver.connection - self._packer = msgpack.Packer(encoding='utf-8', - use_bin_type=True).pack - self._unpacker = functools.partial(msgpack.unpackb, encoding='utf-8') + self._packer = msgpack.Packer(use_bin_type=True).pack + self._unpacker = functools.partial(msgpack.unpackb) @decorators.lazy_property(write=False) def _claim_ctrl(self): diff --git a/zaqar/storage/redis/subscriptions.py b/zaqar/storage/redis/subscriptions.py index 7ff1aae55..b18a004f0 100644 --- a/zaqar/storage/redis/subscriptions.py +++ b/zaqar/storage/redis/subscriptions.py @@ -48,9 +48,8 @@ class SubscriptionController(base.Subscription): def __init__(self, *args, **kwargs): super(SubscriptionController, self).__init__(*args, **kwargs) self._client = self.driver.connection - self._packer = msgpack.Packer(encoding='utf-8', - use_bin_type=True).pack - self._unpacker = functools.partial(msgpack.unpackb, encoding='utf-8') + self._packer = msgpack.Packer(use_bin_type=True).pack + self._unpacker = functools.partial(msgpack.unpackb) @utils.raises_conn_error @utils.retries_on_connection_error diff --git a/zaqar/tests/unit/common/test_decorators.py b/zaqar/tests/unit/common/test_decorators.py index d0615f532..8d92c484e 100644 --- a/zaqar/tests/unit/common/test_decorators.py +++ b/zaqar/tests/unit/common/test_decorators.py @@ -83,8 +83,7 @@ class TestDecorators(base.TestBase): self.assertEqual(1, instance.project_gets) # Should be in the cache now. - project = msgpack.unpackb(cache.get(create_key(*args)), - encoding='utf-8') + project = msgpack.unpackb(cache.get(create_key(*args))) self.assertEqual(sample_project, project) # Should read from the cache this time (counter will not @@ -128,7 +127,7 @@ class TestDecorators(base.TestBase): self.assertEqual(1, instance.user_gets) # Should be in the cache now. - user = msgpack.unpackb(cache.get(name), encoding='utf-8') + user = msgpack.unpackb(cache.get(name)) self.assertEqual(name, user) # Should read from the cache this time (counter will not diff --git a/zaqar/tests/unit/transport/websocket/utils.py b/zaqar/tests/unit/transport/websocket/utils.py index 0bfa51156..589a676ca 100644 --- a/zaqar/tests/unit/transport/websocket/utils.py +++ b/zaqar/tests/unit/transport/websocket/utils.py @@ -38,8 +38,8 @@ def get_pack_tools(binary=None): if binary is None: raise Exception("binary param is unspecified") if binary: - dumps = msgpack.Packer(encoding='utf-8', use_bin_type=False).pack - loads = functools.partial(msgpack.unpackb, encoding='utf-8') + dumps = msgpack.Packer(use_bin_type=False).pack + loads = functools.partial(msgpack.unpackb) create_request_function = create_binary_request else: dumps = json.dumps diff --git a/zaqar/tests/unit/transport/websocket/v2/test_subscriptions.py b/zaqar/tests/unit/transport/websocket/v2/test_subscriptions.py index 83c07cdc5..a3569f6a3 100644 --- a/zaqar/tests/unit/transport/websocket/v2/test_subscriptions.py +++ b/zaqar/tests/unit/transport/websocket/v2/test_subscriptions.py @@ -347,8 +347,7 @@ class SubscriptionTest(base.V1_1Base): # Check that the server sent the websocket notification in binary # format self.assertEqual(3, sender.call_count) - ws_notification = msgpack.unpackb(sender.call_args_list[2][0][0], - encoding='utf-8') + ws_notification = msgpack.unpackb(sender.call_args_list[2][0][0]) self.assertEqual({'body': {'status': 'disco queen'}, 'ttl': 60, 'queue_name': 'kitkat', 'Message_Type': u'Notification'}, ws_notification) diff --git a/zaqar/transport/websocket/protocol.py b/zaqar/transport/websocket/protocol.py index 10f642aaa..b00a51ad8 100644 --- a/zaqar/transport/websocket/protocol.py +++ b/zaqar/transport/websocket/protocol.py @@ -80,7 +80,7 @@ class MessagingProtocol(websocket.WebSocketServerProtocol): # Deserialize the request try: if isBinary: - payload = msgpack.unpackb(payload, encoding='utf-8') + payload = msgpack.unpackb(payload) else: if isinstance(payload, bytes): payload = payload.decode()