Merge "Fix venv for ./run_tests.sh -p"
diff --git a/stress/test_floating_ips.py b/stress/test_floating_ips.py
index f23dca2..9d89510 100755
--- a/stress/test_floating_ips.py
+++ b/stress/test_floating_ips.py
@@ -36,14 +36,13 @@
return None
floating_ip.change_pending = True
timeout = int(kwargs.get('timeout', 60))
+ cli = manager.floating_ips_client
if floating_ip.server_id is None:
server = random.choice(self.server_ids)
address = floating_ip.address
self._logger.info('Adding %s to server %s' % (address, server))
- resp, body =\
- manager.floating_ips_client.associate_floating_ip_to_server(
- address,
- server)
+ resp, body = cli.associate_floating_ip_to_server(address,
+ server)
if resp.status != 202:
raise Exception("response: %s body: %s" % (resp, body))
floating_ip.server_id = server
@@ -53,9 +52,8 @@
server = floating_ip.server_id
address = floating_ip.address
self._logger.info('Removing %s from server %s' % (address, server))
- resp, body =\
- manager.floating_ips_client.disassociate_floating_ip_from_server(
- address, server)
+ resp, body = cli.disassociate_floating_ip_from_server(address,
+ server)
if resp.status != 202:
raise Exception("response: %s body: %s" % (resp, body))
return VerifyChangeFloatingIp(manager, floating_ip,
diff --git a/stress/test_server_actions.py b/stress/test_server_actions.py
index ca66dec..3b4e71c 100644
--- a/stress/test_server_actions.py
+++ b/stress/test_server_actions.py
@@ -56,8 +56,7 @@
reboot_target = target[0]
# It seems that doing a reboot when in reboot is an error.
try:
- response, body = manager.servers_client.reboot(
- reboot_target['id'],
+ response, body = manager.servers_client.reboot(reboot_target['id'],
_reboot_arg)
except Duplicate:
return
diff --git a/tempest/config.py b/tempest/config.py
index 5321e18..2b0eb70 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -473,9 +473,7 @@
"""Provides OpenStack configuration information."""
DEFAULT_CONFIG_DIR = os.path.join(
- os.path.abspath(
- os.path.dirname(
- os.path.dirname(__file__))),
+ os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
"etc")
DEFAULT_CONFIG_FILE = "tempest.conf"
diff --git a/tempest/services/identity/json/admin_client.py b/tempest/services/identity/json/admin_client.py
index 6c36195..7ea33b5 100644
--- a/tempest/services/identity/json/admin_client.py
+++ b/tempest/services/identity/json/admin_client.py
@@ -181,9 +181,10 @@
def create_service(self, name, type, **kwargs):
"""Create a service"""
post_body = {
- 'name': name,
- 'type': type,
- 'description': kwargs.get('description')}
+ 'name': name,
+ 'type': type,
+ 'description': kwargs.get('description')
+ }
post_body = json.dumps({'OS-KSADM:service': post_body})
resp, body = self.post('/OS-KSADM/services', post_body, self.headers)
body = json.loads(body)
diff --git a/tempest/tests/boto/test_ec2_security_groups.py b/tempest/tests/boto/test_ec2_security_groups.py
index ee403c0..c10f1df 100644
--- a/tempest/tests/boto/test_ec2_security_groups.py
+++ b/tempest/tests/boto/test_ec2_security_groups.py
@@ -41,7 +41,7 @@
group_description)
self.addResourceCleanUp(self.client.delete_security_group, group_name)
groups_get = self.client.get_all_security_groups(
- groupnames=(group_name,))
+ groupnames=(group_name,))
self.assertEqual(len(groups_get), 1)
group_get = groups_get[0]
self.assertEqual(group.name, group_get.name)
@@ -63,7 +63,7 @@
self.assertTrue(success)
#TODO(afazekas): Duplicate tests
group_get = self.client.get_all_security_groups(
- groupnames=(group_name,))[0]
+ groupnames=(group_name,))[0]
#remove listed rules
for ip_permission in group_get.rules:
for cidr in ip_permission.grants:
@@ -74,6 +74,6 @@
to_port=ip_permission.to_port))
group_get = self.client.get_all_security_groups(
- groupnames=(group_name,))[0]
+ groupnames=(group_name,))[0]
#all rules shuld be removed now
self.assertEqual(0, len(group_get.rules))
diff --git a/tempest/tests/compute/images/test_images_whitebox.py b/tempest/tests/compute/images/test_images_whitebox.py
index 8eb258c..c2a5b05 100644
--- a/tempest/tests/compute/images/test_images_whitebox.py
+++ b/tempest/tests/compute/images/test_images_whitebox.py
@@ -57,9 +57,9 @@
instances = self.meta.tables['instances']
stmt = instances.update().where(instances.c.uuid == server_id).values(
- deleted=deleted,
- vm_state=vm_state,
- task_state=task_state)
+ deleted=deleted,
+ vm_state=vm_state,
+ task_state=task_state)
self.connection.execute(stmt, autocommit=True)
diff --git a/tempest/tests/compute/servers/test_list_servers_negative.py b/tempest/tests/compute/servers/test_list_servers_negative.py
index 9e8f826..dc6e339 100644
--- a/tempest/tests/compute/servers/test_list_servers_negative.py
+++ b/tempest/tests/compute/servers/test_list_servers_negative.py
@@ -164,8 +164,8 @@
def test_list_servers_by_changes_since(self):
"""Servers are listed by specifying changes-since date"""
- resp, body = self.client.list_servers(
- {'changes-since': '2011-01-01T12:34:00Z'})
+ changes_since = {'changes-since': '2011-01-01T12:34:00Z'}
+ resp, body = self.client.list_servers(changes_since)
self.assertEqual('200', resp['status'])
# changes-since returns all instances, including deleted.
num_expected = (len(self.existing_fixtures) +
@@ -179,8 +179,8 @@
def test_list_servers_by_changes_since_future_date(self):
"""Return an empty list when a date in the future is passed"""
- resp, body = self.client.list_servers(
- {'changes-since': '2051-01-01T12:34:00Z'})
+ changes_since = {'changes-since': '2051-01-01T12:34:00Z'}
+ resp, body = self.client.list_servers(changes_since)
self.assertEqual('200', resp['status'])
self.assertEqual(0, len(body['servers']))
diff --git a/tempest/tests/compute/servers/test_servers_whitebox.py b/tempest/tests/compute/servers/test_servers_whitebox.py
index c02a1a2..16254e7 100644
--- a/tempest/tests/compute/servers/test_servers_whitebox.py
+++ b/tempest/tests/compute/servers/test_servers_whitebox.py
@@ -56,8 +56,8 @@
"""Disallow server creation when tenant's vcpu quota is full"""
quotas = self.meta.tables['quotas']
stmt = quotas.select().where(
- quotas.c.project_id == self.tenant_id).where(
- quotas.c.resource == 'cores')
+ quotas.c.project_id == self.tenant_id).where(
+ quotas.c.resource == 'cores')
result = self.connection.execute(stmt).first()
# Set vcpu quota for tenant if not already set
@@ -88,8 +88,8 @@
"""Disallow server creation when tenant's memory quota is full"""
quotas = self.meta.tables['quotas']
stmt = quotas.select().where(
- quotas.c.project_id == self.tenant_id).where(
- quotas.c.resource == 'ram')
+ quotas.c.project_id == self.tenant_id).where(
+ quotas.c.resource == 'ram')
result = self.connection.execute(stmt).first()
# Set memory quota for tenant if not already set
@@ -123,9 +123,9 @@
instances = self.meta.tables['instances']
stmt = instances.update().where(instances.c.uuid == server_id).values(
- deleted=deleted,
- vm_state=vm_state,
- task_state=task_state)
+ deleted=deleted,
+ vm_state=vm_state,
+ task_state=task_state)
self.connection.execute(stmt, autocommit=True)
def _test_delete_server_base(self, vm_state, task_state):
diff --git a/tempest/tests/identity/base.py b/tempest/tests/identity/base.py
index 2c84583..3867f0a 100644
--- a/tempest/tests/identity/base.py
+++ b/tempest/tests/identity/base.py
@@ -111,8 +111,8 @@
self.test_tenant = rand_name('test_tenant_')
self.test_description = rand_name('desc_')
resp, self.tenant = self.client.create_tenant(
- name=self.test_tenant,
- description=self.test_description)
+ name=self.test_tenant,
+ description=self.test_description)
self.tenants.append(self.tenant)
def setup_test_role(self):
diff --git a/tools/pip-requires b/tools/pip-requires
index a0128e8..061eff6 100644
--- a/tools/pip-requires
+++ b/tools/pip-requires
@@ -9,3 +9,4 @@
python-glanceclient>=0.5.0
python-keystoneclient>=0.2.0
python-novaclient>=2.10.0
+python-quantumclient>=2.1
diff --git a/tox.ini b/tox.ini
index e2dbdc8..2d8e627 100644
--- a/tox.ini
+++ b/tox.ini
@@ -15,4 +15,4 @@
[testenv:pep8]
deps = pep8==1.3.3
-commands = python tools/hacking.py --ignore=N4,E121,E122,E125,E126 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack .
+commands = python tools/hacking.py --ignore=N4,E122,E125,E126 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack,*egg .