Link to home
Start Free TrialLog in
Avatar of beer9
beer9Flag for India

asked on

Getting python error while running ansible command

I am getting below error while running ansible

$ansible -vvv windows -m win_ping
<ec2-54-145-217-177.compute-1.amazonaws.com> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO ec2-54-145-217-177.compute-1.amazonaws.com
ec2-54-145-217-177.compute-1.amazonaws.com | FAILED => Traceback (most recent call last):
  File "/home/ansible/ansible/lib/python2.7/site-packages/ansible/runner/__init__.py", line 586, in _executor
    exec_rc = self._executor_internal(host, new_stdin)
  File "/home/ansible/ansible/lib/python2.7/site-packages/ansible/runner/__init__.py", line 789, in _executor_internal
    return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
  File "/home/ansible/ansible/lib/python2.7/site-packages/ansible/runner/__init__.py", line 968, in _executor_internal_inner
    conn = self.connector.connect(actual_host, actual_port, actual_user, actual_pass, actual_transport, actual_private_key_file, delegate_host)
  File "/home/ansible/ansible/lib/python2.7/site-packages/ansible/runner/connection.py", line 52, in connect
    self.active = conn.connect()
  File "/home/ansible/ansible/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py", line 140, in connect
    self.protocol = self._winrm_connect()
  File "/home/ansible/ansible/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py", line 96, in _winrm_connect
    protocol.send_message('')
  File "/home/ansible/ansible/lib/python2.7/site-packages/winrm/protocol.py", line 193, in send_message
    return self.transport.send_message(message)
  File "/home/ansible/ansible/lib/python2.7/site-packages/winrm/transport.py", line 108, in send_message
    response = self.opener.open(request, timeout=self.timeout)
  File "/usr/local/lib/python2.7/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/local/lib/python2.7/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/local/lib/python2.7/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python2.7/urllib2.py", line 1181, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/local/lib/python2.7/urllib2.py", line 1142, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/local/lib/python2.7/httplib.py", line 946, in request
    self._send_request(method, url, body, headers)
  File "/usr/local/lib/python2.7/httplib.py", line 986, in _send_request
    self.putheader(hdr, value)
  File "/usr/local/lib/python2.7/httplib.py", line 924, in putheader
    str = '%s: %s' % (header, '\r\n\t'.join(values))
TypeError: sequence item 0: expected string, int found

Open in new window


I am running python 2.7 in virtual environment, appreciate any help
Avatar of beer9
beer9
Flag of India image

ASKER

appreciate any help here
ASKER CERTIFIED SOLUTION
Avatar of Mark Brady
Mark Brady
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial