Modify

Ticket #1158 (new defect)

Opened 5 years ago

server: multiprocessing: observe the iterator protocol

Reported by: https://www.google.com/accounts/o8/id?id=AItOawkfHvWdYf7g8kSZA32s7dhK0Xig9JKo_CA Owned by: desai
Priority: major Milestone: Bcfg2 1.4.0 Release
Component: bcfg2-server Version: 1.0
Keywords: server multiprocessing Cc:

Description

In 1.4.0pre1 this caused exception. We can use next(iterable) or iterable.__next__() - I'm not sure which works better in old Python versions (2.4?).

--- a/src/lib/Bcfg2/Server/MultiprocessingCore.py
+++ b/src/lib/Bcfg2/Server/MultiprocessingCore.py
@@ -439,7 +439,7 @@
     @exposed
     def GetConfig(self, address):
         client = self.resolve_client(address)[0]
-        childname = self.children.next()
+        childname = next(self.children)
         self.logger.debug("Building configuration for %s on %s" % (client,
                                                                    childname))
         return self.rpc_q.rpc(childname, "GetConfig", args=[client])

/mkd

Attachments

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.