diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 0020c946..1104370b 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -28,6 +28,7 @@ Release Notes * PubSub tests has been all been disabled * New feature, host_port_remap. Send in a remapping configuration to RedisCluster instance where the nodes configuration recieved from the redis cluster can be altered to allow for connection in certain circumstances. See new section in clients.rst in docs/ for usage example. * When a slot is not covered by the cluster, it will not raise SlotNotCoveredError instead of the old generic RedisClusterException. The client will not attempt to rebuild the cluster layout a few times before giving up and raising that exception to the user. (#350) + * CLIENT SETNAME is now possible to use from the client instance. For setting the name for all connections from the client by default, see issue #802 in redis-py repo for the change that was implemented in redis-py 3.4.0. 2.0.0 (Aug 12, 2019) diff --git a/rediscluster/client.py b/rediscluster/client.py index bd88e408..7266e1ae 100644 --- a/rediscluster/client.py +++ b/rediscluster/client.py @@ -101,7 +101,6 @@ class RedisCluster(Redis): 'ACL USERS', 'ACL WHOAMI', 'BITOP', - 'CLIENT SETNAME', 'MOVE', 'SCRIPT KILL', 'SENTINEL GET-MASTER-ADDR-BY-NAME', @@ -122,6 +121,7 @@ class RedisCluster(Redis): "CLIENT ID", "CLIENT KILL", "CLIENT LIST", + "CLIENT SETNAME", "CLUSTER INFO", "CONFIG GET", "CONFIG RESETSTAT", @@ -213,6 +213,7 @@ class RedisCluster(Redis): "CLIENT ID", "CLIENT KILL", "CLIENT LIST", + "CLIENT SETNAME", "CLUSTER INFO", "CONFIG GET", "CONFIG RESETSTAT", diff --git a/tests/test_commands.py b/tests/test_commands.py index 62e11578..63a7f0e4 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -295,7 +295,7 @@ def test_client_getname(self, r): assert r.client_getname() is None @skip_if_server_version_lt('2.6.9') - @skip_for_no_cluster_impl() + @pytest.mark.skip(reason="Cluster specific override") def test_client_setname(self, r): assert r.client_setname('redis_py_test') assert r.client_getname() == 'redis_py_test' diff --git a/tests/test_commands_cluster.py b/tests/test_commands_cluster.py index db32c1a6..089bc3ea 100644 --- a/tests/test_commands_cluster.py +++ b/tests/test_commands_cluster.py @@ -92,6 +92,11 @@ def test_client_unblock(self, r): def test_client_getname(self, r): assert get_main_cluster_node_data(r.client_getname()) is None + @skip_if_server_version_lt('2.6.9') + def test_client_setname(self, r): + assert r.client_setname('redis_py_test') + assert get_main_cluster_node_data(r.client_getname()) == 'redis_py_test' + def test_config_get(self, r): data = get_main_cluster_node_data(r.config_get()) assert 'maxmemory' in data