ansible/ansible — pull request #1650 by dagwieers (2012-11-20 18:08:06+00:00)
Title: Provide a proper error when the provided port is not an integer

As reported on the mailinglist, the user received a ValueError when the port number was not templated (fixed in #1649) and therefore it was not an integer. This change will catch the exception and provide a proper error so it is more clear.

Before:
```
fatal: [moria] => Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/ansible/runner/__init__.py", line 233, in _executor
exec_rc = self._executor_internal(host)
File "/usr/lib/python2.6/site-packages/ansible/runner/__init__.py", line 289, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port)
File "/usr/lib/python2.6/site-packages/ansible/runner/__init__.py", line 381, in _executor_internal_inner
actual_port = int(actual_port)
ValueError: invalid literal for int() with base 10: 'abc'
```
After:
```
fatal: [moria] => {'msg': 'FAILED: Configured port "abc" is not a valid port, expected integer', 'failed': True}
```