Merge "Fixes around variable usage"
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 2116e1e..02cf970 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -403,7 +403,7 @@
url = self.base_url + '/servers?all_tenants=1'
resp = self.requests.get(url)
- resp, body = self.post('servers', post_body, self.headers)
+ resp, body = self.get('servers', self.headers)
body = json.loads(body)
return resp, body['servers']
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index 0bfa5e3..ac1859a 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -40,7 +40,7 @@
def update_object(self, container, object_name, data):
"""Upload data to replace current storage object."""
- return create_object(container, object_name, data)
+ return self.create_object(container, object_name, data)
def delete_object(self, container, object_name):
"""Delete storage object."""
diff --git a/tempest/services/volume/xml/snapshots_client.py b/tempest/services/volume/xml/snapshots_client.py
index c89f66e..dc70cb7 100644
--- a/tempest/services/volume/xml/snapshots_client.py
+++ b/tempest/services/volume/xml/snapshots_client.py
@@ -85,10 +85,6 @@
body = xml_to_json(etree.fromstring(body))
return resp, body
- def _get_snapshot_status(self, snapshot_id):
- resp, body = self.get_snapshot(snapshot_id)
- return body['status']
-
#NOTE(afazekas): just for the wait function
def _get_snapshot_status(self, snapshot_id):
resp, body = self.get_snapshot(snapshot_id)
diff --git a/tempest/testboto.py b/tempest/testboto.py
index 4887667..14844b3 100644
--- a/tempest/testboto.py
+++ b/tempest/testboto.py
@@ -376,7 +376,7 @@
snaps = volume.snapshots()
if len(snaps):
LOG.critical("%s Volume has %s snapshot(s)", volume.id,
- map(snps.id, snaps))
+ map(snaps.id, snaps))
#Note(afazekas): detaching/attching not valid EC2 status
def _volume_state():
diff --git a/tempest/tests/boto/test_ec2_instance_run.py b/tempest/tests/boto/test_ec2_instance_run.py
index 533ea1a..403ec4c 100644
--- a/tempest/tests/boto/test_ec2_instance_run.py
+++ b/tempest/tests/boto/test_ec2_instance_run.py
@@ -85,8 +85,8 @@
state = state_wait(_state, "available")
if state != "available":
for _image in cls.images.itervalues():
- ec2_client.deregister_image(_image["image_id"])
- raise RegisterImageException(image_id=image["image_id"])
+ cls.ec2_client.deregister_image(_image["image_id"])
+ raise EC2RegisterImageException(image_id=image["image_id"])
@attr(type='smoke')
def test_run_stop_terminate_instance(self):
diff --git a/tempest/tests/boto/test_ec2_network.py b/tempest/tests/boto/test_ec2_network.py
index ef476a2..ef307a1 100644
--- a/tempest/tests/boto/test_ec2_network.py
+++ b/tempest/tests/boto/test_ec2_network.py
@@ -47,4 +47,4 @@
address.disassociate)
self.client.release_address(public_ip)
self.cancelResourceCleanUp(rcuk)
- assertAddressReleasedWait(address)
+ self.assertAddressReleasedWait(address)
diff --git a/tempest/tests/compute/servers/test_server_metadata.py b/tempest/tests/compute/servers/test_server_metadata.py
index a214d15..ef1b956 100644
--- a/tempest/tests/compute/servers/test_server_metadata.py
+++ b/tempest/tests/compute/servers/test_server_metadata.py
@@ -197,7 +197,6 @@
def test_delete_nonexistant_server_metadata_item(self):
# Negative test: Should not be able to delete metadata item from a
# nonexistant server
- meta = {'d': 'delvalue'}
#Delete the metadata item
try:
diff --git a/tempest/tests/compute/test_authorization.py b/tempest/tests/compute/test_authorization.py
index 8f4ad50..d826d40 100644
--- a/tempest/tests/compute/test_authorization.py
+++ b/tempest/tests/compute/test_authorization.py
@@ -243,7 +243,6 @@
# Reset the base_url...
self.alt_security_client.base_url = self.saved_base_url
if resp['status'] is not None:
- resp, _ = \
self.alt_security_client.delete_security_group(body['id'])
self.fail("Create Security Group request should not happen if"
"the tenant id does not match the current user")
@@ -283,7 +282,6 @@
# Reset the base_url...
self.alt_security_client.base_url = self.saved_base_url
if resp['status'] is not None:
- resp, _ = \
self.alt_security_client.delete_security_group_rule(
body['id'])
self.fail("Create security group rule request should not "
diff --git a/tempest/tests/compute/test_live_block_migration.py b/tempest/tests/compute/test_live_block_migration.py
index 3824ac1..6449ddc 100644
--- a/tempest/tests/compute/test_live_block_migration.py
+++ b/tempest/tests/compute/test_live_block_migration.py
@@ -123,8 +123,8 @@
server_id = self._get_an_active_server()
target_host = self._get_non_existing_host_name()
- with self.assertRaises(exceptions.BadRequest) as cm:
- self._migrate_server_to(server_id, target_host)
+ self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
+ server_id, target_host)
self.assertEquals('ACTIVE', self._get_server_status(server_id))
@classmethod
diff --git a/tempest/tests/network/base.py b/tempest/tests/network/base.py
index 5af7e2c..8606079 100644
--- a/tempest/tests/network/base.py
+++ b/tempest/tests/network/base.py
@@ -29,8 +29,6 @@
def setUpClass(cls):
os = clients.Manager()
client = os.network_client
- config = os.config
- networks = []
enabled = True
# Validate that there is even an endpoint configured
diff --git a/tempest/tests/network/test_network_basic_ops.py b/tempest/tests/network/test_network_basic_ops.py
index d297c98..aed368e 100644
--- a/tempest/tests/network/test_network_basic_ops.py
+++ b/tempest/tests/network/test_network_basic_ops.py
@@ -184,7 +184,6 @@
def setUpClass(cls):
super(TestNetworkBasicOps, cls).setUpClass()
cls.check_preconditions()
- cfg = cls.config.network
cls.tenant_id = cls.manager._get_identity_client(
cls.config.identity.username,
cls.config.identity.password,
diff --git a/tempest/tests/object_storage/base.py b/tempest/tests/object_storage/base.py
index 7f81ec6..2492d8b 100644
--- a/tempest/tests/object_storage/base.py
+++ b/tempest/tests/object_storage/base.py
@@ -47,6 +47,5 @@
try:
cls.account_client.list_account_containers()
except exceptions.EndpointNotFound:
- enabled = False
skip_msg = "No OpenStack Object Storage API endpoint"
raise cls.skipException(skip_msg)