Skip to content
Snippets Groups Projects
Commit 80f2bcb4 authored by Anael Beutot's avatar Anael Beutot
Browse files

jobs: use count itertool instead of home made

parent df73583f
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ import sys ...@@ -24,6 +24,7 @@ import sys
import traceback import traceback
from threading import Thread, Event from threading import Thread, Event
from StringIO import StringIO from StringIO import StringIO
from itertools import count
from cloudcontrol.node.exc import JobError from cloudcontrol.node.exc import JobError
from cloudcontrol.node.utils import num_to_sig, close_fds from cloudcontrol.node.utils import num_to_sig, close_fds
...@@ -37,13 +38,7 @@ class JobManager(object): ...@@ -37,13 +38,7 @@ class JobManager(object):
""" """
:param main_loop: :class:`MainLoop` instance :param main_loop: :class:`MainLoop` instance
""" """
def counter(): self.job_id = count()
i = 0
while True:
yield i
i += 1
self.job_id = counter()
self.main = main_loop self.main = main_loop
#: keep an index of all jobs #: keep an index of all jobs
self.jobs = {} self.jobs = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment