diff --git a/dusty/daemon.py b/dusty/daemon.py index afe76bcb..c627a412 100644 --- a/dusty/daemon.py +++ b/dusty/daemon.py @@ -12,9 +12,10 @@ import logging import socket import threading +# requests refused to play nicely with pyinstaller +import httplib from docopt import docopt -import requests from .preflight import preflight_check, refresh_preflight_warnings from .log import configure_logging, make_socket_logger, close_socket_logger @@ -66,10 +67,12 @@ def close_client_connection(terminator=SOCKET_TERMINATOR): def shut_down_http_server(): logging.info('Daemon is shutting down HTTP server') try: - r = requests.post('http://{}:{}/shutdown'.format(constants.DAEMON_HTTP_BIND_IP, - constants.DAEMON_HTTP_BIND_PORT), - timeout=2) - r.raise_for_status() + h = httplib.HTTPConnection('{}:{}'.format(constants.DAEMON_HTTP_BIND_IP, + constants.DAEMON_HTTP_BIND_PORT)) + h.request('POST', '/shutdown') + r = h.getresponse() + if r.status != 200: + raise ValueError('Got status code {} from response'.format(r.status)) except Exception as e: logging.exception('Exception trying to shut down HTTP server') diff --git a/requirements.py b/requirements.py index 2beaa143..64b9f003 100644 --- a/requirements.py +++ b/requirements.py @@ -7,7 +7,6 @@ 'Schemer==0.2.9', 'psutil==2.2.1', 'Flask==0.10.1', - 'requests==2.5.1', ] test_requires = [