Unlike previous questions like TypeError: argument of type 'int' is not iterable there doesn't seem to be an immediately obvious indexing problem in my case.
In the code below, testcfg.agents is a list of hostnames and/or IP addresses, and testcfg.port is the port which xmlrpc calls should use. The DSEvent class models events in Active Directory, and DSEvent.eventcommand is a list containing a command and its parameters (passed through xmlrpc calls to an agent, which executes it using the subprocess module.)
# Create a list of agents to process events from
agent_list = []
for a in testcfg.agents:
agent_list.append(xmlrpc.client.ServerProxy("http://" + a + ':' + testcfg.port))
# Initial user creation:
for j in range(5):
init_event = DSEvent(type = 'add', is_important = True)
agent_eB = random.choice(agent_list)
agent_eB.execute(init_event.eventcommand) # This line throws the fault described below!
The exact exception I'm getting is (with various tracebacks into the module stripped out):
xmlrpc.client.Fault: <Fault 1: "<class 'TypeError'>:argument of type 'int' is not iterable">
I can't understand where this fault might be coming from. While init_event.eventcommand is an iterable object (a list) I've passed and returned iterable objects via xmlrpc in other code without encountering this error. I've checked for accidental variable reuse, and I don't think that's the problem either. I'd really love some help here!
For reference, here's the full traceback for this error:
Traceback (most recent call last):
File "C:\Users\Administrator\Downloads\randeventmaker\randeventmakerengine.py",
line 861, in <module>
sproxy.execute(initializing_event.eventcommand)
File "C:\Python32\lib\xmlrpc\client.py", line 1095, in __call__
return self.__send(self.__name, args)
File "C:\Python32\lib\xmlrpc\client.py", line 1423, in __request
verbose=self.__verbose
File "C:\Python32\lib\xmlrpc\client.py", line 1136, in request
return self.single_request(host, handler, request_body, verbose)
File "C:\Python32\lib\xmlrpc\client.py", line 1151, in single_request
return self.parse_response(resp)
File "C:\Python32\lib\xmlrpc\client.py", line 1323, in parse_response
return u.close()
File "C:\Python32\lib\xmlrpc\client.py", line 667, in close
raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'TypeError'>:argument of type 'int' is
not iterable">