Skip to content

Commit

Permalink
Merge pull request #33 from pyfarm/http_endpoints
Browse files Browse the repository at this point in the history
fixing typos and import names for Python 3
  • Loading branch information
opalmer committed Apr 15, 2014
2 parents 20ab5cd + 1dc705c commit 6fffc34
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pyfarm/agent/http/api/assign.py
Expand Up @@ -19,7 +19,7 @@
try:
from httplib import ACCEPTED, BAD_REQUEST
except ImportError: # pragma: no cover
from httplib.client import ACCEPTED, BAD_REQUEST
from http.client import ACCEPTED, BAD_REQUEST

from twisted.web.server import NOT_DONE_YET
from voluptuous import Invalid, Schema, Required, Optional, Any
Expand Down Expand Up @@ -106,7 +106,7 @@ def post(self, **kwargs):
requires_cpus = data["job"].get("cpus")

# Do we have enough ram?
if requires_cpus is not None and requires_ram > memory_free:
if requires_ram is not None and requires_ram > memory_free:
logger.error(
"Task %s requires %sMB of ram, this agent has %sMB free. "
"Rejecting Task %s.",
Expand Down
2 changes: 1 addition & 1 deletion pyfarm/agent/http/core/resource.py
Expand Up @@ -29,7 +29,7 @@
responses, NOT_FOUND, BAD_REQUEST, UNSUPPORTED_MEDIA_TYPE,
METHOD_NOT_ALLOWED)
except ImportError: # pragma: no cover
from httplib.client import (
from http.client import (
responses, NOT_FOUND, BAD_REQUEST, UNSUPPORTED_MEDIA_TYPE,
METHOD_NOT_ALLOWED)

Expand Down
2 changes: 1 addition & 1 deletion pyfarm/agent/http/core/server.py
Expand Up @@ -29,7 +29,7 @@ class can consume on start.
try:
from httplib import FORBIDDEN
except ImportError: # pragma: no cover
from httplib.client import FORBIDDEN
from http.client import FORBIDDEN

from os.path import exists

Expand Down
2 changes: 1 addition & 1 deletion pyfarm/agent/service.py
Expand Up @@ -495,7 +495,7 @@ def errback_search_for_agent(self, failure):
def callback_post_free_ram(self, response):
"""
Called when we get a response back from the master
after posing a change for ``free_ram``
after POSTing a change for ``free_ram``
"""
self.last_free_ram_post = time.time()
if response.code == OK:
Expand Down

0 comments on commit 6fffc34

Please sign in to comment.