summaryrefslogtreecommitdiffstats
path: root/newton
diff options
context:
space:
mode:
Diffstat (limited to 'newton')
-rw-r--r--newton/newton/proxy/tests/test_identity_proxy.py10
-rw-r--r--newton/newton/proxy/views/identityV3.py3
-rw-r--r--newton/newton/pub/exceptions.py1
-rw-r--r--newton/newton/requests/tests/test_reqeust.py6
-rw-r--r--newton/newton/requests/views/flavor.py14
-rw-r--r--newton/newton/requests/views/image.py5
-rw-r--r--newton/newton/requests/views/network.py3
-rw-r--r--newton/newton/requests/views/server.py11
-rw-r--r--newton/newton/requests/views/subnet.py3
-rw-r--r--newton/newton/requests/views/util.py1
-rw-r--r--newton/newton/requests/views/volume.py3
-rw-r--r--newton/newton/requests/views/vport.py2
-rw-r--r--newton/newton/samples/tests.py3
-rw-r--r--newton/newton/swagger/tests.py3
14 files changed, 0 insertions, 68 deletions
diff --git a/newton/newton/proxy/tests/test_identity_proxy.py b/newton/newton/proxy/tests/test_identity_proxy.py
index 6a1a5c88..a61113ee 100644
--- a/newton/newton/proxy/tests/test_identity_proxy.py
+++ b/newton/newton/proxy/tests/test_identity_proxy.py
@@ -505,10 +505,6 @@ class mock_catalog_response_specs(object):
class TestIdentityService(unittest.TestCase):
def setUp(self):
self.client = Client()
- pass
-
- def tearDown(self):
- pass
@mock.patch.object(VimDriverUtils, 'get_vim_info')
@mock.patch.object(VimDriverUtils, 'get_session')
@@ -544,10 +540,6 @@ class TestIdentityService(unittest.TestCase):
self.assertTrue(response['X-Subject-Token'] == mock_token_id)
self.assertTrue(context['token']['catalog'] != None)
- pass
-
-
-
@mock.patch.object(VimDriverUtils, 'get_vim_info')
@mock.patch.object(VimDriverUtils, 'get_session')
@@ -587,5 +579,3 @@ class TestIdentityService(unittest.TestCase):
self.assertTrue(response['X-Subject-Token'] == mock_token_id)
self.assertTrue(context['catalog'] != None)
-
- pass
diff --git a/newton/newton/proxy/views/identityV3.py b/newton/newton/proxy/views/identityV3.py
index b75dcd3b..b06fb1e6 100644
--- a/newton/newton/proxy/views/identityV3.py
+++ b/newton/newton/proxy/views/identityV3.py
@@ -104,7 +104,6 @@ def update_catalog(vimid, catalog, multicould_namespace):
return catalog, metadata_catalog
else:
return None
- pass
@@ -151,7 +150,6 @@ class Tokens(APIView):
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
class Catalog(APIView):
@@ -199,4 +197,3 @@ class Catalog(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
diff --git a/newton/newton/pub/exceptions.py b/newton/newton/pub/exceptions.py
index b750d0a8..2adf0ffa 100644
--- a/newton/newton/pub/exceptions.py
+++ b/newton/newton/pub/exceptions.py
@@ -15,4 +15,3 @@ class VimDriverNewtonException(Exception):
super(VimDriverNewtonException, self).__init__(message)
self.status_code = status_code
self.content = content
- pass
diff --git a/newton/newton/requests/tests/test_reqeust.py b/newton/newton/requests/tests/test_reqeust.py
index bae2b84b..d094314d 100644
--- a/newton/newton/requests/tests/test_reqeust.py
+++ b/newton/newton/requests/tests/test_reqeust.py
@@ -16,11 +16,5 @@ from django.test import TestCase
class TestNetworksRequest(TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
def assert_true_result(self):
self.assertTrue(1)
diff --git a/newton/newton/requests/views/flavor.py b/newton/newton/requests/views/flavor.py
index eebfe2bb..f63f7752 100644
--- a/newton/newton/requests/views/flavor.py
+++ b/newton/newton/requests/views/flavor.py
@@ -49,7 +49,6 @@ class Flavors(APIView):
spec['keyName']=k
spec['value']=v
extraSpecs.append(spec)
- pass
def get(self, request, vimid="", tenantid="", flavorid=""):
logger.debug("Flavors--get::> %s" % request.data)
@@ -83,7 +82,6 @@ class Flavors(APIView):
if k == "name":
wanted = v
break
- pass
if wanted:
oldFlavors = content.pop("flavors", None)
@@ -91,7 +89,6 @@ class Flavors(APIView):
for flavor in oldFlavors:
if wanted == flavor["name"]:
content["flavors"].append(flavor)
- pass
#iterate each flavor to get extra_specs
@@ -124,7 +121,6 @@ class Flavors(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
def get_flavor_extra_specs(self, sess, flavorid):
if not flavorid:
@@ -136,7 +132,6 @@ class Flavors(APIView):
resp = sess.get(req_resouce, endpoint_filter=self.service)
return resp
- pass
def get_flavor(self, sess, request, flavorid=""):
logger.debug("Flavors--get basic")
@@ -156,7 +151,6 @@ class Flavors(APIView):
resp = sess.get(req_resouce, endpoint_filter=self.service)
return resp
- pass
def post(self, request, vimid="", tenantid="", flavorid=""):
@@ -181,7 +175,6 @@ class Flavors(APIView):
elif hasattr(request.data, "id") and flavor["id"] == request.data["id"]:
existed = True
break
- pass
if existed == True:
extraResp = self.get_flavor_extra_specs(sess, flavor["id"])
@@ -254,7 +247,6 @@ class Flavors(APIView):
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
def create_flavor(self, sess, request):
@@ -269,7 +261,6 @@ class Flavors(APIView):
req_body = json.JSONEncoder().encode({"flavor": flavor})
return sess.post(req_resouce, data=req_body,
endpoint_filter=self.service)
- pass
@@ -288,7 +279,6 @@ class Flavors(APIView):
return sess.post(req_resouce, data=req_body,
endpoint_filter=self.service)
- pass
@@ -318,7 +308,6 @@ class Flavors(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
def delete_flavor_extra_specs(self, sess, flavorid):
@@ -332,7 +321,6 @@ class Flavors(APIView):
# just try to delete extra spec, but do not care if succeeded
self.delete_flavor_one_extra_spec(sess, flavorid, k)
return resp
- pass
def delete_flavor_one_extra_spec(self, sess, flavorid, extra_spec_key):
logger.debug("Flavors--delete 1 extra::> %s" % extra_spec_key)
@@ -356,7 +344,6 @@ class Flavors(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
def delete_flavor(self, sess, flavorid):
@@ -372,5 +359,4 @@ class Flavors(APIView):
resp = sess.delete(req_resouce, endpoint_filter=self.service)
return resp
- pass
diff --git a/newton/newton/requests/views/image.py b/newton/newton/requests/views/image.py
index ae3eacd5..ff507bd2 100644
--- a/newton/newton/requests/views/image.py
+++ b/newton/newton/requests/views/image.py
@@ -71,7 +71,6 @@ class imageThread (threading.Thread):
logger.error(traceback.format_exc())
logger.error("Failed to transfer_image:%s" % str(e))
return None
- pass
class Images(APIView):
service = {'service_type': 'image',
@@ -146,7 +145,6 @@ class Images(APIView):
if image["name"] == request.data["name"]:
existed = True
break
- pass
if existed == True:
vim_dict = {
"returnCode": 0,
@@ -199,7 +197,6 @@ class Images(APIView):
tmp_thread.start()
else:
logger.debug("resp.status_code: %s" % resp.status_code)
- pass
return Response(data=resp_body, status=resp.status_code)
except VimDriverNewtonException as e:
@@ -214,7 +211,6 @@ class Images(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
def delete(self, request, vimid="", tenantid="", imageid=""):
logger.debug("Images--delete::> %s" % request.data)
@@ -237,4 +233,3 @@ class Images(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
diff --git a/newton/newton/requests/views/network.py b/newton/newton/requests/views/network.py
index 9c59e95e..09b0af27 100644
--- a/newton/newton/requests/views/network.py
+++ b/newton/newton/requests/views/network.py
@@ -103,7 +103,6 @@ class Networks(APIView):
if network["name"] == request.data["name"]:
existed = True
break
- pass
if existed == True:
vim_dict = {
"returnCode": 0,
@@ -141,7 +140,6 @@ class Networks(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
def delete(self, request, vimid="", tenantid="", networkid=""):
logger.debug("Networks--delete::> %s" % request.data)
@@ -167,7 +165,6 @@ class Networks(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
class Subnets(APIView):
diff --git a/newton/newton/requests/views/server.py b/newton/newton/requests/views/server.py
index d2221323..34e8b51a 100644
--- a/newton/newton/requests/views/server.py
+++ b/newton/newton/requests/views/server.py
@@ -91,7 +91,6 @@ class serverThread (threading.Thread):
logger.error(traceback.format_exc())
logger.debug("Failed to attach_volume:%s" % str(e))
return None
- pass
def detach_volume(self, vimid, tenantid, serverid, *volumeids):
@@ -123,7 +122,6 @@ class serverThread (threading.Thread):
logger.error(traceback.format_exc())
logger.debug("Failed to detach_volume:%s" % str(e))
return None
- pass
class Servers(APIView):
service = {'service_type': 'compute',
@@ -145,7 +143,6 @@ class Servers(APIView):
running_threads[serverId] = tmp_thread
running_thread_lock.release()
tmp_thread.start()
- pass
def dettachVolume(self, vimid, tenantid, serverId, *volumeIds):
# assume attachment id is the same as volume id
@@ -161,7 +158,6 @@ class Servers(APIView):
"Accept": "application/json"})
logger.debug("Servers--dettachVolume resp status::>%s" % resp.status_code)
- pass
def convertMetadata(self, metadata, mata_data, reverse=False):
if reverse == False:
@@ -175,7 +171,6 @@ class Servers(APIView):
spec['value'] = v
metadata.append(spec)
- pass
def convert_resp(self, server):
#convert volumeArray
@@ -297,7 +292,6 @@ class Servers(APIView):
if server["name"] == request.data["name"]:
existed = True
break
- pass
if existed == True and server:
vim_dict = {
"returnCode": 0,
@@ -353,7 +347,6 @@ class Servers(APIView):
personalities.append({"path": context["fileName"], "contents": context["fileData"]})
if len(personalities) > 0:
server["personality"] = personalities
- pass
volumearray = server.pop("volumeArray", None)
@@ -373,8 +366,6 @@ class Servers(APIView):
# server is created, now attach volumes
volumeIds = [extraVolume["volumeId"] for extraVolume in volumearray]
self.attachVolume(vimid, tenantid, resp_body["id"], *volumeIds)
- pass
- pass
metadata = resp_body.pop("metadata", None)
if metadata:
@@ -405,7 +396,6 @@ class Servers(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
def delete(self, request, vimid="", tenantid="", serverid=""):
logger.debug("Servers--delete::> %s" % request.data)
@@ -437,4 +427,3 @@ class Servers(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
diff --git a/newton/newton/requests/views/subnet.py b/newton/newton/requests/views/subnet.py
index 12f0c084..e22b5d63 100644
--- a/newton/newton/requests/views/subnet.py
+++ b/newton/newton/requests/views/subnet.py
@@ -105,7 +105,6 @@ class Subnets(APIView):
if subnet["name"] == request.data["name"]:
existed = True
break
- pass
if existed == True:
vim_dict = {
"returnCode": 0,
@@ -143,7 +142,6 @@ class Subnets(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
def delete(self, request, vimid="", tenantid="", subnetid=""):
logger.debug("Subnets--delete::> %s" % request.data)
@@ -169,4 +167,3 @@ class Subnets(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
diff --git a/newton/newton/requests/views/util.py b/newton/newton/requests/views/util.py
index eab4c370..b94a9ed3 100644
--- a/newton/newton/requests/views/util.py
+++ b/newton/newton/requests/views/util.py
@@ -88,7 +88,6 @@ class VimDriverUtils(object):
else:
#something wrong
return None
- pass
#preload auth_state which was acquired in last requests
if auth_state:
diff --git a/newton/newton/requests/views/volume.py b/newton/newton/requests/views/volume.py
index b5aa0bab..f2b753a6 100644
--- a/newton/newton/requests/views/volume.py
+++ b/newton/newton/requests/views/volume.py
@@ -106,7 +106,6 @@ class Volumes(APIView):
if volume["name"] == request.data["name"]:
existed = True
break
- pass
if existed == True:
vim_dict = {
"returnCode": 0,
@@ -145,7 +144,6 @@ class Volumes(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
def delete(self, request, vimid="", tenantid="", volumeid=""):
logger.debug("Volumes--delete::> %s" % request.data)
@@ -168,4 +166,3 @@ class Volumes(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
diff --git a/newton/newton/requests/views/vport.py b/newton/newton/requests/views/vport.py
index 17f8e83a..18af5092 100644
--- a/newton/newton/requests/views/vport.py
+++ b/newton/newton/requests/views/vport.py
@@ -115,7 +115,6 @@ class Vports(APIView):
if port["name"] == request.data["name"]:
existed = True
break
- pass
if existed == True:
vim_dict = {
"returnCode": 0,
@@ -201,4 +200,3 @@ class Vports(APIView):
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- pass
diff --git a/newton/newton/samples/tests.py b/newton/newton/samples/tests.py
index d419efa5..bbf6dcbd 100644
--- a/newton/newton/samples/tests.py
+++ b/newton/newton/samples/tests.py
@@ -19,9 +19,6 @@ class SampleViewTest(unittest.TestCase):
def setUp(self):
self.client = Client()
- def tearDown(self):
- pass
-
def test_sample(self):
response = self.client.get("/samples/")
self.assertEqual(status.HTTP_200_OK, response.status_code, response.content)
diff --git a/newton/newton/swagger/tests.py b/newton/newton/swagger/tests.py
index 29efb26b..78546039 100644
--- a/newton/newton/swagger/tests.py
+++ b/newton/newton/swagger/tests.py
@@ -19,9 +19,6 @@ class SampleViewTest(unittest.TestCase):
def setUp(self):
self.client = Client()
- def tearDown(self):
- pass
-
def test_sample(self):
response = self.client.get("/api/multicloud-newton/v0/swagger.json")
self.assertEqual(status.HTTP_200_OK, response.status_code, response.content)