import json
import httplib2
import logging

log = logging.getLogger(__name__)

def _lock_url(ctx):
    try:
        return ctx.teuthology_config['lock_server']
    except (AttributeError, KeyError):
        return "http://teuthology.front.sepia.ceph.com/locker/lock"
 
def send_request(method, url, body=None, headers=None):
    http = httplib2.Http()
    resp, content = http.request(url, method=method, body=body, headers=headers)
    if resp.status == 200:
        return (True, content, resp.status)
    log.info("%s request to '%s' with body '%s' failed with response code %d",
             method, url, body, resp.status)
    return (False, None, resp.status)

def get_status(ctx, name):
    success, content, _ = send_request('GET', _lock_url(ctx) + '/' + name)
    if success:
        return json.loads(content)
    return None

@@ -40,233 +40,81 @@
 ing%0A
-%0Alog = logging.getLogger(__name__)%0A%0Adef _lock_url(ctx):%0A    try:%0A        return ctx.teuthology_config%5B'lock_server'%5D%0A    except (AttributeError, KeyError):%0A        return %22http://teuthology.front.sepia.ceph.com/locker/lock%22%0A 
+import os%0Afrom .config import config%0A%0Alog = logging.getLogger(__name__)%0A%0A
 %0Adef
@@ -508,16 +508,17 @@
 tatus)%0A%0A
+%0A
 def get_
@@ -586,36 +586,47 @@
 T', 
-_lock_url(ctx) + '/' +
+os.path.join(config.lock_server,
  name)
+)
 %0A   

Use teuthology.config.