Fix variables reference in the integration tests methods

In the common integration tests methods: _wait_for_stack_status and
_wait_for_resource_status local variables 'res' and 'stack' were used
outside the loop where they were referenced.

Change-Id: I4b68054a9474dbfe36955602e7961e9328bb278e
Closes-Bug: #1428064
diff --git a/common/test.py b/common/test.py
index 2392b8e..8c2a0d2 100644
--- a/common/test.py
+++ b/common/test.py
@@ -204,7 +204,7 @@
 
         message = ('Resource %s failed to reach %s status within '
                    'the required time (%s s).' %
-                   (res.resource_name, status, build_timeout))
+                   (resource_name, status, build_timeout))
         raise exceptions.TimeoutException(message)
 
     def _wait_for_stack_status(self, stack_identifier, status,
@@ -243,7 +243,7 @@
 
         message = ('Stack %s failed to reach %s status within '
                    'the required time (%s s).' %
-                   (stack.stack_name, status, build_timeout))
+                   (stack_identifier, status, build_timeout))
         raise exceptions.TimeoutException(message)
 
     def _stack_delete(self, stack_identifier):