]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Fix backtrace when using loadbalancer
authorSteven Dake <sdake@redhat.com>
Mon, 17 Sep 2012 19:51:21 +0000 (12:51 -0700)
committerSteven Dake <sdake@redhat.com>
Mon, 17 Sep 2012 19:51:21 +0000 (12:51 -0700)
Loadbalancer incorrectly tried to reference a string as an integer.

This resulted in the following typeerror which is repaired by
thi patch:

    timeout_check = 'timeout check %ds' % (health_chk['Timeout'])
TypeError: %d format: a number is required, not unicode

Fixes issue #240

Change-Id: I7e2697200d3fa9b0cb009f3a7898d487b70fc23a
Signed-off-by: Steven Dake <sdake@redhat.com>
heat/engine/loadbalancer.py

index bedeedfb7a5f0fad458e66535501e40b230d374e..fab1e67f48ab8f783eccd11eeab2ad595c5cded4 100644 (file)
@@ -257,7 +257,7 @@ class LoadBalancer(stack.Stack):
                     health_chk['Interval'],
                     health_chk['UnhealthyThreshold'],
                     health_chk['HealthyThreshold'])
-            timeout_check = 'timeout check %ds' % (health_chk['Timeout'])
+            timeout_check = 'timeout check %ds' % int(health_chk['Timeout'])
         else:
             check = ''
             timeout_check = ''