danb35/deploy-freenas

Fails with deactivated ftp

MalteHillmann opened this issue · 1 comments

Hi!

I've tried your script. At first: python2.7 works great, too.
But my FreeNAS box has disabled ftp, so the script crashes with output:

Certificate import successful
Certificate list successful
Setting active certificate successful
Traceback (most recent call last):
  File "deploy_freenas.py", line 142, in <module> "ftp_ssltls_certfile": cert,
  File "/usr/local/lib/python2.7/site-packages/requests-2.22.0-py2.7.egg/requests/api.py", line 131, in put
    return request('put', url, data=data, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests-2.22.0-py2.7.egg/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests-2.22.0-py2.7.egg/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests-2.22.0-py2.7.egg/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests-2.22.0-py2.7.egg/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='XXXXXXXXXXXXXXXXXXXXXXXXXX', port=80): 
Max retries exceeded with url: /api/v1.0/services/ftp/ (Caused by
NewConnectionError('<urllib3.connection.HTTPConnection object at 0x42688d50>: 
Failed to establish a new connection: [Errno 61] Connection refused',))

I've commented out the last request and last check. Now it works great.
Maybe you can add a check if the server has ftp enabled?

Regards
Malte

This should be fixed with #15. Can you confirm?