self.suite_repo_path = self.args.suite_dir
else:
self.suite_repo_path = util.fetch_repos(
- suite_branch, test_name=self.name)
+ suite_branch, test_name=self.name, dry_run=self.args.dry_run)
teuthology_branch, teuthology_sha1 = self.choose_teuthology_branch()
if not kernel_hash:
util.schedule_fail(
"Kernel branch '{branch}' not found".format(
- branch=self.args.kernel_branch)
+ branch=self.args.kernel_branch),
+ dry_run=self.args.dry_run,
)
if kernel_hash:
log.info("kernel sha1: {hash}".format(hash=kernel_hash))
self.args.ceph_sha1,
'%s.git' % repo_name
)
- util.schedule_fail(message=str(exc), name=self.name)
+ util.schedule_fail(message=str(exc), name=self.name, dry_run=self.args.dry_run)
log.info("ceph sha1 explicitly supplied")
elif self.args.ceph_branch:
self.args.ceph_branch,
'%s.git' % repo_name
)
- util.schedule_fail(message=str(exc), name=self.name)
+ util.schedule_fail(message=str(exc), name=self.name, dry_run=self.args.dry_run)
log.info("ceph sha1: {hash}".format(hash=ceph_hash))
return ceph_hash
self.args.distro_version, self.args.machine_type,
)
except Exception as exc:
- util.schedule_fail(str(exc), self.name)
+ util.schedule_fail(str(exc), self.name, dry_run=self.args.dry_run)
log.info("ceph version: {ver}".format(ver=ceph_version))
return ceph_version
else:
)
if not teuthology_sha1:
exc = BranchNotFoundError(teuthology_branch, build_git_url('teuthology'))
- util.schedule_fail(message=str(exc), name=self.name)
+ util.schedule_fail(message=str(exc), name=self.name, dry_run=self.args.dry_run)
log.info("teuthology branch: %s %s", teuthology_branch, teuthology_sha1)
return teuthology_branch, teuthology_sha1
suite_branch
):
exc = BranchNotFoundError(suite_branch, suite_repo_name)
- util.schedule_fail(message=str(exc), name=self.name)
+ util.schedule_fail(message=str(exc), name=self.name, dry_run=self.args.dry_run)
elif not suite_branch:
# Decide what branch of the suite repo to use
if util.git_branch_exists(suite_repo_project_or_url, ceph_branch):
)
if not suite_hash:
exc = BranchNotFoundError(suite_branch, suite_repo_name)
- util.schedule_fail(message=str(exc), name=self.name)
+ util.schedule_fail(message=str(exc), name=self.name, dry_run=self.args.dry_run)
log.info("%s branch: %s %s", suite_repo_name, suite_branch, suite_hash)
return suite_hash
"At least one job needs packages that don't exist for "
"hash {sha1}.".format(sha1=self.base_config.sha1),
name,
+ dry_run=self.args.dry_run,
)
util.teuthology_schedule(
args=job['args'],
200 to 1000: Large test runs that can be done over the course of a week.
Note: To force run, use --force-priority'''
if priority < 50:
- util.schedule_fail(msg)
+ util.schedule_fail(msg, dry_run=self.args.dry_run)
elif priority < 75 and jobs_to_schedule > 25:
- util.schedule_fail(msg)
+ util.schedule_fail(msg, dry_run=self.args.dry_run)
elif priority < 150 and jobs_to_schedule > 100:
- util.schedule_fail(msg)
+ util.schedule_fail(msg, dry_run=self.args.dry_run)
def check_num_jobs(self, jobs_to_schedule):
"""
Note: If you still want to go ahead, use --job-threshold 0'''
if threshold and jobs_to_schedule > threshold:
- util.schedule_fail(msg)
+ util.schedule_fail(msg, dry_run=self.args.dry_run)
def schedule_suite(self):
"""
util.schedule_fail(
'Exceeded %d backtracks; raise --newest value' % limit,
name,
+ dry_run=self.args.dry_run,
)
if self.args.dry_run:
CONTAINER_FLAVOR = 'default'
-def fetch_repos(branch, test_name):
+def fetch_repos(branch, test_name, dry_run):
"""
Fetch the suite repo (and also the teuthology repo) so that we can use it
to build jobs. Repos are stored in ~/src/.
fetch_teuthology('main')
suite_repo_path = fetch_qa_suite(branch)
except BranchNotFoundError as exc:
- schedule_fail(message=str(exc), name=test_name)
+ schedule_fail(message=str(exc), name=test_name, dry_run=dry_run)
return suite_repo_path
-def schedule_fail(message, name=''):
+def schedule_fail(message, name='', dry_run=None):
"""
If an email address has been specified anywhere, send an alert there. Then
raise a ScheduleFailError.
+ Don't send the mail if --dry-run has been passed.
"""
email = config.results_email
- if email:
+ if email and not dry_run:
subject = "Failed to schedule {name}".format(name=name)
msg = MIMEText(message)
msg['Subject'] = subject