]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Allow setting results_email in teuthology.yaml
authorZack Cerza <zack@cerza.org>
Thu, 3 Jul 2014 00:39:47 +0000 (18:39 -0600)
committerZack Cerza <zack@cerza.org>
Thu, 3 Jul 2014 00:39:47 +0000 (18:39 -0600)
(Instead of passing --email to teuthology-suite)

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
scripts/suite.py
teuthology/suite.py

index 5646363247e9c426eabdd56eae6ae899ceb54b0a..842416a619b99e10630bba2b33af25b52b8602f2 100644 (file)
@@ -50,7 +50,9 @@ Standard arguments:
 Scheduler arguments:
   --owner <owner>             Job owner
   -e <email>, --email <email>
-                              When tests finish or time out, send an email here
+                              When tests finish or time out, send an email
+                              here. May also be specified in ~/.teuthology.yaml
+                              as 'results_email'
   -N <num>, --num <num>       Number of times to run/queue the job
                               [default: 1]
   -l <jobs>, --limit <jobs>   Queue at most this many jobs
index 9ce500f85e1ed12fd5189b74ed37b3336482ff46..40782716bef10612a645e3ff74635c12c6651df5 100644 (file)
@@ -48,7 +48,6 @@ def main(args):
     owner = args['--owner']
     email = args['--email']
     if email:
-        config.email_specified = True
         config.results_email = email
     timeout = args['--timeout']
 
@@ -75,7 +74,6 @@ def main(args):
                          machine_type=machine_type,
                          suite_repo_path=suite_repo_path,
                          base_yaml_paths=base_yaml_paths,
-                         email=email,
                          priority=priority,
                          limit=limit,
                          num=num,
@@ -219,14 +217,15 @@ def create_initial_config(nice_suite, ceph_branch, teuthology_branch,
 
 
 def prepare_and_schedule(owner, name, suite, machine_type, suite_repo_path,
-                         base_yaml_paths, email, priority, limit, num, timeout,
+                         base_yaml_paths, priority, limit, num, timeout,
                          dry_run, verbose):
     """
     Puts together some "base arguments" with which to execute
     teuthology-schedule for each job, then passes them and other parameters to
     schedule_suite(). Finally, schedules a "last-in-suite" job that sends an
-    email to the specified address (if one is specified).
+    email to the specified address (if one is configured).
     """
+    email = config.results_email
     arch = get_arch(machine_type)
 
     base_args = [
@@ -258,8 +257,7 @@ def prepare_and_schedule(owner, name, suite, machine_type, suite_repo_path,
     if email and num_jobs:
         arg = copy.deepcopy(base_args)
         arg.append('--last-in-suite')
-        if email:
-            arg.extend(['--email', email])
+        arg.extend(['--email', email])
         if timeout:
             arg.extend(['--timeout', timeout])
         if dry_run: