← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~harlowja/cloud-init/no-negative-max-wait into lp:cloud-init

 

Joshua Harlow has proposed merging lp:~harlowja/cloud-init/no-negative-max-wait into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~harlowja/cloud-init/no-negative-max-wait/+merge/215020

Fix max_wait being showed as < 0
-- 
https://code.launchpad.net/~harlowja/cloud-init/no-negative-max-wait/+merge/215020
Your team cloud init development team is requested to review the proposed merge of lp:~harlowja/cloud-init/no-negative-max-wait into lp:cloud-init.
=== modified file 'cloudinit/sources/DataSourceOpenStack.py'
--- cloudinit/sources/DataSourceOpenStack.py	2014-02-24 22:41:42 +0000
+++ cloudinit/sources/DataSourceOpenStack.py	2014-04-09 19:31:17 +0000
@@ -58,8 +58,8 @@
         # move it to a shared location instead...
         # Note: the defaults here are different though.
 
-        # max_wait < 0 indicates do not wait
-        max_wait = -1
+        # max_wait <= 0 indicates do not wait
+        max_wait = 0
         timeout = 10
 
         try:

=== modified file 'cloudinit/url_helper.py'
--- cloudinit/url_helper.py	2014-02-13 17:13:42 +0000
+++ cloudinit/url_helper.py	2014-04-09 19:31:17 +0000
@@ -296,9 +296,13 @@
 
     if status_cb is None:
         status_cb = log_status_cb
+    if max_wait is None:
+        max_wait = 0
+    else:
+        max_wait = max(0, max_wait)
 
     def timeup(max_wait, start_time):
-        return ((max_wait <= 0 or max_wait is None) or
+        return ((max_wait == 0) or
                 (time.time() - start_time > max_wait))
 
     loop_n = 0


Follow ups