diff --git a/libra/worker/drivers/haproxy/ubuntu_services.py b/libra/worker/drivers/haproxy/ubuntu_services.py index a7386b93..6413a6c6 100644 --- a/libra/worker/drivers/haproxy/ubuntu_services.py +++ b/libra/worker/drivers/haproxy/ubuntu_services.py @@ -39,7 +39,13 @@ class UbuntuServices(services_base.ServicesBase): """ Save current HAProxy totals for an expected restart. """ - q = query.HAProxyQuery('/var/run/haproxy-stats.socket') + socket_file = '/var/run/haproxy-stats.socket' + + # On a new device, the socket file won't exist. + if not os.path.exists(socket_file): + return + + q = query.HAProxyQuery(socket_file) results = q.get_bytes_out() stats_file = cfg.CONF['worker:haproxy']['statsfile']