Merge "Remove automated skip decsion from compute"
diff --git a/requirements.txt b/requirements.txt
index 19d6e0b..df9951d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,7 +3,7 @@
 anyjson
 nose
 httplib2>=0.7.0
-testtools>=0.9.29
+testtools>=0.9.32
 lxml
 boto>=2.2.1
 paramiko
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 8068284..03e73df 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -73,6 +73,7 @@
         cidr = netaddr.IPNetwork(cls.network_cfg.tenant_network_cidr)
         mask_bits = cls.network_cfg.tenant_network_mask_bits
         # Find a cidr that is not in use yet and create a subnet with it
+        body = None
         failure = None
         for subnet_cidr in cidr.subnet(mask_bits):
             try:
diff --git a/tempest/api/orchestration/stacks/test_stacks.py b/tempest/api/orchestration/stacks/test_stacks.py
index 8847c08..5fed581 100644
--- a/tempest/api/orchestration/stacks/test_stacks.py
+++ b/tempest/api/orchestration/stacks/test_stacks.py
@@ -45,19 +45,19 @@
 
         # count how many stacks to start with
         resp, body = self.client.list_stacks()
-        stack_count = len(body['stacks'])
 
         # create the stack
         stack_identifier = self.create_stack(
             stack_name, self.empty_template)
+        stack_id = stack_identifier.split('/')[1]
 
         # wait for create complete (with no resources it should be instant)
         self.client.wait_for_stack_status(stack_identifier, 'CREATE_COMPLETE')
 
-        # stack count will increment by 1
+        # check for stack in list
         resp, body = self.client.list_stacks()
-        self.assertEqual(stack_count + 1, len(body['stacks']),
-                         'Expected stack count to increment by 1')
+        list_ids = list([stack['id'] for stack in body['stacks']])
+        self.assertIn(stack_id, list_ids)
 
         # fetch the stack
         resp, body = self.client.get_stack(stack_identifier)
@@ -68,7 +68,6 @@
         self.assertEqual('CREATE_COMPLETE', body['stack_status'])
 
         # fetch the stack by id
-        stack_id = stack_identifier.split('/')[1]
         resp, body = self.client.get_stack(stack_id)
         self.assertEqual('CREATE_COMPLETE', body['stack_status'])
 
diff --git a/tempest/services/compute/xml/security_groups_client.py b/tempest/services/compute/xml/security_groups_client.py
index 4f9d347..5d86790 100644
--- a/tempest/services/compute/xml/security_groups_client.py
+++ b/tempest/services/compute/xml/security_groups_client.py
@@ -98,7 +98,9 @@
         """
         group_rule = Element("security_group_rule")
 
-        elements = {k: kwargs.get(k) for k in ('cidr', 'group_id')}
+        elements = dict()
+        elements['cidr'] = kwargs.get('cidr')
+        elements['group_id'] = kwargs.get('group_id')
         elements['parent_group_id'] = parent_group_id
         elements['ip_protocol'] = ip_proto
         elements['from_port'] = from_port