]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Use teuthology.config.
authorZack Cerza <zack@cerza.org>
Fri, 20 Sep 2013 19:00:46 +0000 (14:00 -0500)
committerZack Cerza <zack@cerza.org>
Fri, 20 Sep 2013 19:00:46 +0000 (14:00 -0500)
Also use os.path.join()

teuthology/lockstatus.py

index 5c25479efc7669cd5c3897f696fba6d1e47a2567..44821cc4ca8ee7bd82a99ef786189dbfce0d4851 100644 (file)
@@ -1,15 +1,12 @@
 import json
 import httplib2
 import logging
+import os
+from .config import config
 
 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)
@@ -19,8 +16,9 @@ def send_request(method, url, body=None, headers=None):
              method, url, body, resp.status)
     return (False, None, resp.status)
 
+
 def get_status(ctx, name):
-    success, content, _ = send_request('GET', _lock_url(ctx) + '/' + name)
+    success, content, _ = send_request('GET', os.path.join(config.lock_server, name))
     if success:
         return json.loads(content)
     return None