Merge lp:~harlowja/cloud-init/no-negative-max-wait into lp:~cloud-init-dev/cloud-init/trunk

Proposed by Joshua Harlow
Status: Rejected
Rejected by: Scott Moser
Proposed branch: lp:~harlowja/cloud-init/no-negative-max-wait
Merge into: lp:~cloud-init-dev/cloud-init/trunk
Diff against target: 33 lines (+7/-3)
2 files modified
cloudinit/sources/DataSourceOpenStack.py (+2/-2)
cloudinit/url_helper.py (+5/-1)
To merge this branch: bzr merge lp:~harlowja/cloud-init/no-negative-max-wait
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Needs Fixing
cloud-init Commiters Pending
Review via email: mp+215020@code.launchpad.net

Description of the change

Fix max_wait being showed as < 0

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

Hello,
Thank you for taking the time to contribute to cloud-init. Cloud-init has moved its revision control system to git. As a result, we are marking all bzr merge proposals as 'rejected'. If you would like to re-submit this proposal for review, please do so by following the current HACKING documentation at http://cloudinit.readthedocs.io/en/latest/topics/hacking.html .

I think this might be still relevant, so please do re-submit.

Unmerged revisions

972. By Joshua Harlow

Fix max_wait being showed as < 0

Ensure that max_wait is always >= 0 so that
when it is displayed it doesn't show up as a
negative number (which is confusing).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cloudinit/sources/DataSourceOpenStack.py'
2--- cloudinit/sources/DataSourceOpenStack.py 2014-02-24 22:41:42 +0000
3+++ cloudinit/sources/DataSourceOpenStack.py 2014-04-09 19:31:17 +0000
4@@ -58,8 +58,8 @@
5 # move it to a shared location instead...
6 # Note: the defaults here are different though.
7
8- # max_wait < 0 indicates do not wait
9- max_wait = -1
10+ # max_wait <= 0 indicates do not wait
11+ max_wait = 0
12 timeout = 10
13
14 try:
15
16=== modified file 'cloudinit/url_helper.py'
17--- cloudinit/url_helper.py 2014-02-13 17:13:42 +0000
18+++ cloudinit/url_helper.py 2014-04-09 19:31:17 +0000
19@@ -296,9 +296,13 @@
20
21 if status_cb is None:
22 status_cb = log_status_cb
23+ if max_wait is None:
24+ max_wait = 0
25+ else:
26+ max_wait = max(0, max_wait)
27
28 def timeup(max_wait, start_time):
29- return ((max_wait <= 0 or max_wait is None) or
30+ return ((max_wait == 0) or
31 (time.time() - start_time > max_wait))
32
33 loop_n = 0