summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-18 11:31:25 +0000
committerGerrit Code Review <review@openstack.org>2013-06-18 11:31:25 +0000
commit58566a773fc40cbd8786c97e0a79d485fa82feea (patch)
treecea24a6d457f21286ade942f824ea51aac9b9fd3 /nova/api
parent0707f9b471f0a4f6964cf132502abfae89800360 (diff)
parent9f7eaca80d259201844f097fec24d1e9fe9fb5e3 (diff)
downloadnova-58566a773fc40cbd8786c97e0a79d485fa82feea.tar.gz
nova-58566a773fc40cbd8786c97e0a79d485fa82feea.tar.xz
nova-58566a773fc40cbd8786c97e0a79d485fa82feea.zip
Merge "Remove trivial cases of unused variables (1)"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/cloud.py4
-rw-r--r--nova/api/metadata/password.py1
-rw-r--r--nova/api/openstack/compute/contrib/attach_interfaces.py2
-rw-r--r--nova/api/openstack/compute/contrib/extended_ips.py2
-rw-r--r--nova/api/openstack/compute/contrib/fixed_ips.py3
-rw-r--r--nova/api/openstack/compute/contrib/flavorextraspecs.py2
-rw-r--r--nova/api/openstack/compute/contrib/services.py3
-rw-r--r--nova/api/openstack/compute/servers.py8
8 files changed, 10 insertions, 15 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 47575b201..e02f7b6f9 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -802,7 +802,6 @@ class CloudController(object):
'detaching': 'in-use'}
instance_ec2_id = None
- instance_data = None
if volume.get('instance_uuid', None):
instance_uuid = volume['instance_uuid']
@@ -810,8 +809,7 @@ class CloudController(object):
instance_uuid)
instance_ec2_id = ec2utils.id_to_ec2_inst_id(instance_uuid)
- instance_data = '%s[%s]' % (instance_ec2_id,
- instance['host'])
+
v = {}
v['volumeId'] = ec2utils.id_to_ec2_vol_id(volume['id'])
v['status'] = valid_ec2_api_volume_status_map.get(volume['status'],
diff --git a/nova/api/metadata/password.py b/nova/api/metadata/password.py
index f3453e945..50f6c94ac 100644
--- a/nova/api/metadata/password.py
+++ b/nova/api/metadata/password.py
@@ -49,7 +49,6 @@ def convert_password(context, password):
def handle_password(req, meta_data):
ctxt = context.get_admin_context()
- password = meta_data.password
if req.method == 'GET':
return meta_data.password
elif req.method == 'POST':
diff --git a/nova/api/openstack/compute/contrib/attach_interfaces.py b/nova/api/openstack/compute/contrib/attach_interfaces.py
index ec565a0d1..a823eed2b 100644
--- a/nova/api/openstack/compute/contrib/attach_interfaces.py
+++ b/nova/api/openstack/compute/contrib/attach_interfaces.py
@@ -60,7 +60,7 @@ class InterfaceAttachmentController(object):
port_id = id
try:
- instance = self.compute_api.get(context, server_id)
+ self.compute_api.get(context, server_id)
except exception.NotFound:
raise exc.HTTPNotFound()
diff --git a/nova/api/openstack/compute/contrib/extended_ips.py b/nova/api/openstack/compute/contrib/extended_ips.py
index ac75293a6..20356c08d 100644
--- a/nova/api/openstack/compute/contrib/extended_ips.py
+++ b/nova/api/openstack/compute/contrib/extended_ips.py
@@ -94,7 +94,7 @@ def make_server(elem):
class ExtendedIpsServerTemplate(xmlutil.TemplateBuilder):
def construct(self):
root = xmlutil.TemplateElement('server', selector='server')
- elem = xmlutil.SubTemplateElement(root, 'server', selector='servers')
+ xmlutil.SubTemplateElement(root, 'server', selector='servers')
make_server(root)
return xmlutil.SlaveTemplate(root, 1, nsmap={
Extended_ips.alias: Extended_ips.namespace})
diff --git a/nova/api/openstack/compute/contrib/fixed_ips.py b/nova/api/openstack/compute/contrib/fixed_ips.py
index b474b685d..532282a2b 100644
--- a/nova/api/openstack/compute/contrib/fixed_ips.py
+++ b/nova/api/openstack/compute/contrib/fixed_ips.py
@@ -69,8 +69,7 @@ class FixedIPController(object):
fixed_ip = db.fixed_ip_get_by_address(context, address)
db.fixed_ip_update(context, fixed_ip['address'],
{'reserved': reserved})
- except (exception.FixedIpNotFoundForAddress,
- exception.FixedIpInvalid) as ex:
+ except (exception.FixedIpNotFoundForAddress, exception.FixedIpInvalid):
msg = _("Fixed IP %s not found") % address
raise webob.exc.HTTPNotFound(explanation=msg)
diff --git a/nova/api/openstack/compute/contrib/flavorextraspecs.py b/nova/api/openstack/compute/contrib/flavorextraspecs.py
index 6e33d3603..00e7d7233 100644
--- a/nova/api/openstack/compute/contrib/flavorextraspecs.py
+++ b/nova/api/openstack/compute/contrib/flavorextraspecs.py
@@ -104,7 +104,7 @@ class FlavorExtraSpecsController(object):
extra_spec = db.instance_type_extra_specs_get_item(context,
flavor_id, id)
return extra_spec
- except exception.InstanceTypeExtraSpecsNotFound as e:
+ except exception.InstanceTypeExtraSpecsNotFound:
raise exc.HTTPNotFound()
def delete(self, req, flavor_id, id):
diff --git a/nova/api/openstack/compute/contrib/services.py b/nova/api/openstack/compute/contrib/services.py
index 3a637010a..76eec7ce4 100644
--- a/nova/api/openstack/compute/contrib/services.py
+++ b/nova/api/openstack/compute/contrib/services.py
@@ -183,8 +183,7 @@ class ServiceController(object):
raise webob.exc.HTTPUnprocessableEntity(detail=msg)
try:
- svc = self.host_api.service_update(context, host, binary,
- status_detail)
+ self.host_api.service_update(context, host, binary, status_detail)
except exception.ServiceNotFound:
raise webob.exc.HTTPNotFound(_("Unknown service"))
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index de7a51812..b9e18b501 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -552,10 +552,10 @@ class Controller(wsgi.Controller):
search_opts=search_opts,
limit=limit,
marker=marker)
- except exception.MarkerNotFound as e:
+ except exception.MarkerNotFound:
msg = _('marker [%s] not found') % marker
raise exc.HTTPBadRequest(explanation=msg)
- except exception.FlavorNotFound as e:
+ except exception.FlavorNotFound:
log_msg = _("Flavor '%s' could not be found ")
LOG.debug(log_msg, search_opts['flavor'])
instance_list = []
@@ -1093,11 +1093,11 @@ class Controller(wsgi.Controller):
except exception.InstanceInvalidState as state_error:
common.raise_http_conflict_for_instance_invalid_state(state_error,
'resize')
- except exception.ImageNotAuthorized as image_error:
+ except exception.ImageNotAuthorized:
msg = _("You are not authorized to access the image "
"the instance was started with.")
raise exc.HTTPUnauthorized(explanation=msg)
- except exception.ImageNotFound as image_error:
+ except exception.ImageNotFound:
msg = _("Image that the instance was started "
"with could not be found.")
raise exc.HTTPBadRequest(explanation=msg)