Fix --image support so it only runs on normal jobs.
Right now --image is applied to special tasks like Cleanup and Verify,
when it should only apply to base job tasks. The best short term
solution is to move the command line building to QueueTask.
Longer term we should investigate moving all --image code into site
extensions.
BUG=none
TEST=Running in production.
Change-Id: I983ae1a3e42f3a2cc3d285f763114c7fcb572a56
Reviewed-on: http://gerrit.chromium.org/gerrit/2389
Reviewed-by: Paul Pendlebury <pauldean@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Tested-by: Dale Curtis <dalecurtis@chromium.org>
diff --git a/scheduler/monitor_db.py b/scheduler/monitor_db.py
index cd1f91e..2866d09 100755
--- a/scheduler/monitor_db.py
+++ b/scheduler/monitor_db.py
@@ -246,8 +246,6 @@
if not job:
job = queue_entry.job
autoserv_argv += ['-u', job.owner, '-l', job.name]
- if job.is_image_update_job():
- autoserv_argv += ['--image', job.update_image_path]
if verbose:
autoserv_argv.append('--verbose')
return autoserv_argv + extra_args
@@ -269,7 +267,7 @@
self._seconds_between_garbage_stats = 60 * (
global_config.global_config.get_config_value(
scheduler_config.CONFIG_SECTION,
- 'gc_stats_interval_mins', type=int, default=6*60))
+ 'gc_stats_interval_mins', type=int, default=6 * 60))
def initialize(self, recover_hosts=True):
@@ -607,7 +605,7 @@
def _reverify_hosts_where(self, where,
print_message='Reverifying host %s'):
- full_where='locked = 0 AND invalid = 0 AND ' + where
+ full_where = 'locked = 0 AND invalid = 0 AND ' + where
for host in scheduler_models.Host.fetch(where=full_where):
if self.host_has_agent(host):
# host has already been recovered in some way
@@ -1733,6 +1731,9 @@
if not self.job.is_server_job():
params.append('-c')
+ if self.job.is_image_update_job():
+ params += ['--image', self.job.update_image_path]
+
return params