~maas-deployers/maas-deployer/next

« back to all changes in this revision

Viewing changes to maas_deployer/vmaas/maasclient/bootimages.py

  • Committer: billy.olsen at canonical
  • Date: 2015-12-15 18:10:00 UTC
  • mfrom: (55.1.1 next)
  • Revision ID: billy.olsen@canonical.com-20151215181000-qhr9mg2howt9wtys
[billy-olsen,r=hopem] Fix faulty sequence generator.

The sequence number generator for the boot images polling request could
only perform 4096 queries before failing. This changes that to simply
be a forever incrementing generator.

Closes-Bug: LP #1487938

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
import json
10
10
 
11
11
 
 
12
def sequence_no(num):
 
13
    while True:
 
14
        yield num
 
15
        num = num + 1
 
16
 
 
17
 
12
18
class ImageImportChecker(object):
13
19
    """
14
20
    An object which can check the status of importing boot-images.
19
25
        self.password = password
20
26
        self.headers = {}
21
27
        self.http = httplib2.Http()
22
 
        self.sequence = xrange(1, 4096).__iter__()
 
28
        self.sequence = sequence_no(1)
23
29
 
24
30
    @property
25
31
    def is_logged_in(self):