From f46979b4d5ff67bc781eb798ba99e73317d568a9 Mon Sep 17 00:00:00 2001 From: dynarro Date: Tue, 25 Nov 2014 09:46:34 +0100 Subject: [PATCH] Removed deprecated 'shard' methods Old shard methods were deprecated and a deprecation warning was being raised in the current released version. I removed the deprecated shard methods as well as the shard module. Change-Id: I51dd839b566f5cbea03df9ab8500d9558282a59c Closes-bug: #1395788 --- zaqarclient/queues/v1/client.py | 6 ------ zaqarclient/queues/v1/core.py | 15 +-------------- zaqarclient/queues/v1/shard.py | 27 --------------------------- 3 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 zaqarclient/queues/v1/shard.py diff --git a/zaqarclient/queues/v1/client.py b/zaqarclient/queues/v1/client.py index f1069955..d06ebc98 100644 --- a/zaqarclient/queues/v1/client.py +++ b/zaqarclient/queues/v1/client.py @@ -14,7 +14,6 @@ # limitations under the License. import uuid -import warnings from zaqarclient.common import decorators from zaqarclient.queues.v1 import core @@ -130,11 +129,6 @@ class Client(object): return trans.send(req).deserialized_content # ADMIN API - def shard(self, ref, **kwargs): - warnings.warn(_('`shard_create`\'s been renamed to `pool_create` '), - DeprecationWarning, stacklevel=2) - return self.pool(ref, **kwargs) - def pool(self, ref, **kwargs): """Returns a pool instance diff --git a/zaqarclient/queues/v1/core.py b/zaqarclient/queues/v1/core.py index e694f1d1..b9a30e73 100644 --- a/zaqarclient/queues/v1/core.py +++ b/zaqarclient/queues/v1/core.py @@ -28,8 +28,6 @@ Functions present in this module assume that: """ import json -import warnings - import zaqarclient.transport.errors as errors @@ -414,18 +412,6 @@ def claim_delete(transport, request, queue_name, claim_id): transport.send(request) -def shard_create(transport, request, pool_name, pool_data): - warnings.warn(_('`shard_create`\'s been renamed to `pool_create` '), - DeprecationWarning, stacklevel=2) - return pool_create(transport, request, pool_name, pool_data) - - -def shard_delete(transport, request, pool_name): - warnings.warn(_('`shard_delete`\'s been renamed to `pool_delete` '), - DeprecationWarning, stacklevel=2) - return pool_delete(transport, request, pool_name) - - def pool_get(transport, request, pool_name, callback=None): """Gets pool data @@ -448,6 +434,7 @@ def pool_get(transport, request, pool_name, callback=None): def pool_create(transport, request, pool_name, pool_data): """Creates a pool called `pool_name` + :param transport: Transport instance to use :type transport: `transport.base.Transport` :param request: Request instance ready to be sent. diff --git a/zaqarclient/queues/v1/shard.py b/zaqarclient/queues/v1/shard.py deleted file mode 100644 index 9bfb02d7..00000000 --- a/zaqarclient/queues/v1/shard.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2014 Red Hat, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import warnings - -from zaqarclient.queues.v1 import pool - - -class Shard(pool.Pool): - - def __init__(self, *args, **kwargs): - warnings.warn(_('Shard\'s been renamed to `Pool` ' - 'please use `zaqarclient.queues.v1.pool.Pool` ' - ' instead'), DeprecationWarning, stacklevel=2) - super(Shard, self).__init__(*args, **kwargs)