summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <ranasheel2000@gmail.com>2016-03-14 10:28:06 +0530
committerSheel Rana <ranasheel2000@gmail.com>2016-03-14 06:20:32 +0000
commitb83835d618e72ca46a8bef91ce5cf91bc7ffb45b (patch)
tree29152dfb8e1e3b1da4a46c9a6badafe3b795cbdc
parent9261687395e94d4f0c8cd21600586a0b6079ff7d (diff)
downloadpython-cinderclient-b83835d618e72ca46a8bef91ce5cf91bc7ffb45b.tar.gz
Removed Extra code
Some extra code is present like unused variables, unreachable code after return statement etc. Same is removed. Change-Id: Ifca88a19625c56ed520321ecbdd91739a304be8e
-rw-r--r--cinderclient/tests/unit/fixture_data/snapshots.py12
-rw-r--r--cinderclient/tests/unit/v1/fakes.py5
-rw-r--r--cinderclient/v1/volume_transfers.py1
-rw-r--r--cinderclient/v2/shell.py1
4 files changed, 0 insertions, 19 deletions
diff --git a/cinderclient/tests/unit/fixture_data/snapshots.py b/cinderclient/tests/unit/fixture_data/snapshots.py
index 6fccf79..83adf48 100644
--- a/cinderclient/tests/unit/fixture_data/snapshots.py
+++ b/cinderclient/tests/unit/fixture_data/snapshots.py
@@ -10,8 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import json
-
from cinderclient.tests.unit.fixture_data import base
@@ -48,16 +46,6 @@ class Fixture(base.Fixture):
def action_1234(request, context):
return ''
- body = json.loads(request.body.decode('utf-8'))
- assert len(list(body)) == 1
- action = list(body)[0]
- if action == 'os-reset_status':
- assert 'status' in body['os-reset_status']
- elif action == 'os-update_snapshot_status':
- assert 'status' in body['os-update_snapshot_status']
- else:
- raise AssertionError("Unexpected action: %s" % action)
- return ''
self.requests.register_uri(
'POST', self.url('1234', 'action'),
diff --git a/cinderclient/tests/unit/v1/fakes.py b/cinderclient/tests/unit/v1/fakes.py
index 35043d2..185558a 100644
--- a/cinderclient/tests/unit/v1/fakes.py
+++ b/cinderclient/tests/unit/v1/fakes.py
@@ -236,11 +236,6 @@ class FakeHTTPClient(base_client.HTTPClient):
})
return r, body
- if hasattr(status, 'items'):
- return utils.TestResponse(status), body
- else:
- return utils.TestResponse({"status": status}), body
-
def get_volume_api_version_from_endpoint(self):
magic_tuple = urlparse.urlsplit(self.management_url)
scheme, netloc, path, query, frag = magic_tuple
diff --git a/cinderclient/v1/volume_transfers.py b/cinderclient/v1/volume_transfers.py
index a562c15..633f2ac 100644
--- a/cinderclient/v1/volume_transfers.py
+++ b/cinderclient/v1/volume_transfers.py
@@ -27,7 +27,6 @@ from cinderclient import base
class VolumeTransfer(base.Resource):
"""Transfer a volume from one tenant to another"""
- NAME_ATTR = "display_name"
def __repr__(self):
return "<VolumeTransfer: %s>" % self.id
diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py
index a854ec6..f3725f9 100644
--- a/cinderclient/v2/shell.py
+++ b/cinderclient/v2/shell.py
@@ -2448,7 +2448,6 @@ def do_consisgroup_update(cs, args):
@utils.service_type('volumev2')
def do_cgsnapshot_list(cs, args):
"""Lists all cgsnapshots."""
- cgsnapshots = cs.cgsnapshots.list()
all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants))