Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Bleah
Browse files Browse the repository at this point in the history
  • Loading branch information
dkfellows committed Feb 6, 2017
1 parent 054357a commit d8a669c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spalloc_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class PollingServerCore(object):
def __init__(self):
# The poll object used for listening for connections
self._poll = select.poll() # @UndefinedVariable
if self._poll is None: # pragma: no branch
if self._poll is None: # pragma: no cover
raise Exception("total failure to make a poller")
# Used to map file descriptors to channels
self._fdmap = {}
Expand Down Expand Up @@ -252,8 +252,8 @@ def _read_config_file(self):
self._reload_config = False
try:
with open(self._config_filename, "r") as f:
config_script = f.read() # pragma: no branch
except (IOError, OSError):
config_script = f.read()
except (IOError, OSError): # pragma: no cover
logging.exception("Could not read config file %s",
self._config_filename)
return False
Expand Down Expand Up @@ -287,7 +287,7 @@ def _read_config_file(self):
if (new.ip != old.ip or
self._server_socket is None):
# Close all open connections
if self._close(): # pragma: no branch
if self._close(): # pragma: no cover
time.sleep(0.25) # Ugly hack; fully release socket now

# Create a new server socket
Expand Down Expand Up @@ -355,7 +355,7 @@ def _accept_client(self):
"""Accept a new client."""
try:
client, addr = self._server_socket.accept()
except IOError as e: # pragma: no branch
except IOError as e: # pragma: no cover
logging.warn("problem when accepting connection", exc_info=e)
return
logging.info("New client connected from %s", addr)
Expand Down Expand Up @@ -404,7 +404,7 @@ def _handle_command(self, client, line):
logging.info("lookup failure: %s", commandName)
raise IOError("unrecognised command name")
command = _COMMANDS[commandName]
if command is None: # pragma: no branch
if command is None: # pragma: no cover
# Should be unreachable
logging.critical("unexpected lookup failure: %s", commandName)
raise IOError("unrecognised command name")
Expand Down Expand Up @@ -506,7 +506,7 @@ def _run(self):
self._controller.destroy_timed_out_jobs()

for channel in channels:
if channel is None: # pragma: no branch
if channel is None: # pragma: no cover
continue
if channel == self._server_socket:
# New client connected
Expand Down

0 comments on commit d8a669c

Please sign in to comment.