zerovm / zpm

ZeroVM Package Manager
Apache License 2.0
6 stars 11 forks source link

Traceback on zpm execute without --container #194

Open mgeisler opened 9 years ago

mgeisler commented 9 years ago

When running

$ zpm execute automr.zapp

I got the traceback below. It works if I first deploy the zapp and use --container. This is with zpm 0.3:

Traceback (most recent call last):
  File "/home/mg/.virtualenvs/zpm/bin/zpm", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/mg/src/zpm/zpm", line 29, in <module>
    args.func(args)
  File "/home/mg/src/zpm/zpmlib/commands.py", line 113, in inner
    return func(namespace, *args, **kwargs)
  File "/home/mg/src/zpm/zpmlib/commands.py", line 275, in execute
    resp = zpm.execute(args)
  File "/home/mg/src/zpm/zpmlib/zpm.py", line 762, in execute
    conn.post_zapp(data_reader, response_dict=resp, content_length=size)
  File "/home/mg/src/zpm/zpmlib/zpm.py", line 416, in post_zapp
    content_length=content_length)
  File "/home/mg/.virtualenvs/zpm/local/lib/python2.7/site-packages/swiftclient/client.py", line 1243, in _retry
    rv = func(self.url, self.token, *args, **kwargs)
  File "/home/mg/src/zpm/zpmlib/zpm.py", line 378, in _post_job
    conn.request('POST', parsed.path, data, headers)
  File "/home/mg/.virtualenvs/zpm/local/lib/python2.7/site-packages/swiftclient/client.py", line 217, in request
    files=files, **self.requests_args)
  File "/home/mg/.virtualenvs/zpm/local/lib/python2.7/site-packages/swiftclient/client.py", line 185, in _request
    return self.request_session.request(*arg, **kwarg)
  File "/home/mg/.virtualenvs/zpm/local/lib/python2.7/site-packages/requests/sessions.py", line 457, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/mg/.virtualenvs/zpm/local/lib/python2.7/site-packages/requests/sessions.py", line 569, in send
    r = adapter.send(request, **kwargs)
  File "/home/mg/.virtualenvs/zpm/local/lib/python2.7/site-packages/requests/adapters.py", line 362, in send
    timeout=timeout
  File "/home/mg/.virtualenvs/zpm/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 516, in urlopen
    body=body, headers=headers)
  File "/home/mg/.virtualenvs/zpm/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 308, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python2.7/httplib.py", line 1001, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 854, in _send_output
    self.send(message_body)
  File "/usr/lib/python2.7/httplib.py", line 826, in send
    self.sock.sendall(data)
  File "/usr/lib/python2.7/ssl.py", line 693, in sendall
    amount = len(data)
TypeError: object of type 'callable-iterator' has no len()
mgeisler commented 9 years ago

The code in question was added in dcbcfbee9688 by @pkit . Constantine, on which platform did you test this? I'm using Python 2.7.8 and maybe something changed in httplib.