Merge "Add num_retries configuration option"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index c4eec66..cc91716 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -262,6 +262,9 @@
 #TCP/IP connection timeout
 http_socket_timeout = 5
 
+#Number of retries actions on connection or 5xx error
+num_retries = 1
+
 # Status change wait timout
 build_timeout = 120
 
diff --git a/tempest/config.py b/tempest/config.py
index 6e8076b..25fbbb9 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -476,6 +476,11 @@
         return self.get("http_socket_timeout", "3")
 
     @property
+    def num_retries(self):
+        """boto num_retries on error"""
+        return self.get("num_retries", "1")
+
+    @property
     def build_timeout(self):
         """status change timeout"""
         return float(self.get("build_timeout", "60"))
diff --git a/tempest/services/boto/__init__.py b/tempest/services/boto/__init__.py
index 2cac843..58a2b37 100644
--- a/tempest/services/boto/__init__.py
+++ b/tempest/services/boto/__init__.py
@@ -36,6 +36,7 @@
                  *args, **kwargs):
 
         self.connection_timeout = config.boto.http_socket_timeout
+        self.num_retries = config.boto.num_retries
         self.build_timeout = config.boto.build_timeout
         # We do not need the "path":  "/token" part
         if auth_url:
@@ -63,12 +64,13 @@
             raise NotFound("Unable to get access and secret keys")
         return ec2_cred
 
-    def _config_boto_timeout(self, timeout):
+    def _config_boto_timeout(self, timeout, retries):
         try:
             boto.config.add_section("Boto")
         except DuplicateSectionError:
             pass
         boto.config.set("Boto", "http_socket_timeout", timeout)
+        boto.config.set("Boto", "num_retries", retries)
 
     def __getattr__(self, name):
         """Automatically creates methods for the allowed methods set"""
@@ -86,7 +88,7 @@
             raise AttributeError(name)
 
     def get_connection(self):
-        self._config_boto_timeout(self.connection_timeout)
+        self._config_boto_timeout(self.connection_timeout, self.num_retries)
         if not all((self.connection_data["aws_access_key_id"],
                    self.connection_data["aws_secret_access_key"])):
             if all(self.ks_cred.itervalues()):