]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Move get_http_log_path
authorZack Cerza <zack@cerza.org>
Wed, 11 Sep 2013 14:45:46 +0000 (09:45 -0500)
committerZack Cerza <zack@cerza.org>
Wed, 11 Sep 2013 15:50:42 +0000 (10:50 -0500)
teuthology/misc.py
teuthology/suite.py

index 2a4a924ff2ba691bab89edd400a399e687ba2c37..7725e9efc3e486d5090f3c6becb8390daddd11d1 100644 (file)
@@ -16,6 +16,7 @@ import json
 from teuthology import safepath
 from teuthology import lockstatus
 from .orchestra import run
+from .config import config
 
 log = logging.getLogger(__name__)
 
@@ -25,6 +26,7 @@ is_vm = lambda x: x.startswith('vpm') or x.startswith('ubuntu@vpm')
 
 is_arm = lambda x: x.startswith('tala') or x.startswith('ubuntu@tala') or x.startswith('saya') or x.startswith('ubuntu@saya')
 
+
 def get_testdir(ctx):
     if 'test_path' in ctx.teuthology_config:
         return ctx.teuthology_config['test_path']
@@ -34,6 +36,7 @@ def get_testdir(ctx):
     # this on the server side, it won't work properly.
     return ctx.teuthology_config.get('test_path', '/home/%s/cephtest' % test_user)
 
+
 def get_test_user(ctx):
     """
     :returns: str -- the user to run tests as on remote hosts
@@ -45,6 +48,15 @@ def get_archive_dir(ctx):
     test_dir = get_testdir(ctx)
     return os.path.normpath(os.path.join(test_dir, 'archive'))
 
+
+def get_http_log_path(archive_dir, job_id):
+    http_base = config.archive_server
+    if not http_base:
+        return None
+    archive_subdir = os.path.split(archive_dir)[-1]
+    return os.path.join(http_base, archive_subdir, str(job_id), '')
+
+
 def get_ceph_binary_url(package=None,
                         branch=None, tag=None, sha1=None, dist=None,
                         flavor=None, format=None, arch=None):
index 0f79519dd132ed89163e725ceb1f01e451614dbf..1e21d0568a7a78a26c5f4dec62e47920eabd57f6 100644 (file)
@@ -447,14 +447,6 @@ def _results(args):
         generate_coverage(args)
 
 
-def get_http_log_path(archive_dir, job_id):
-    http_base = config.archive_server
-    if not http_base:
-        return None
-    archive_subdir = os.path.split(archive_dir)[-1]
-    return os.path.join(http_base, archive_subdir, str(job_id), '')
-
-
 def get_jobs(archive_dir):
     dir_contents = os.listdir(archive_dir)
 
@@ -540,7 +532,7 @@ def build_email_body(name, archive_dir, timeout):
                 time=int(summary.get('duration')),
             )
         else:
-            log = get_http_log_path(archive_dir, job)
+            log = teuthology.get_http_log_path(archive_dir, job)
             if log:
                 log_line = email_templates['fail_log_templ'].format(log=log)
             else:
@@ -601,7 +593,7 @@ def build_email_body(name, archive_dir, timeout):
 
     body = email_templates['body_templ'].format(
         name=name,
-        log_root=get_http_log_path(archive_dir, ''),
+        log_root=teuthology.get_http_log_path(archive_dir, ''),
         fail_count=len(failed),
         hung_count=len(hung),
         pass_count=len(passed),