comparison bitten/queue.py @ 894:edde25232852 0.6.x

0.6dev: Merged [972] from trunk.
author osimons
date Tue, 08 Mar 2011 03:23:25 +0000
parents 6b319a8ae32e
children 0cf576cea845
comparison
equal deleted inserted replaced
892:644c53d6f1b6 894:edde25232852
303 Attachment.delete_all(self.env, 'build', build.resource.id, db) 303 Attachment.delete_all(self.env, 'build', build.resource.id, db)
304 db.commit() 304 db.commit()
305 305
306 def should_delete_build(self, build, repos): 306 def should_delete_build(self, build, repos):
307 config = BuildConfig.fetch(self.env, build.config) 307 config = BuildConfig.fetch(self.env, build.config)
308 config_name = config and config.name \
309 or 'unknown config "%s"' % build.config
308 310
309 platform = TargetPlatform.fetch(self.env, build.platform) 311 platform = TargetPlatform.fetch(self.env, build.platform)
310 # Platform may or may not exist anymore - get safe name for logging 312 # Platform may or may not exist anymore - get safe name for logging
311 platform_name = platform and platform.name \ 313 platform_name = platform and platform.name \
312 or 'unknown platform "%s"' % build.platform 314 or 'unknown platform "%s"' % build.platform
317 'revision [%s] on %s because the platform no longer ' 319 'revision [%s] on %s because the platform no longer '
318 'exists', config.name, build.rev, platform_name) 320 'exists', config.name, build.rev, platform_name)
319 return True 321 return True
320 322
321 # Ignore pending builds for deactived build configs 323 # Ignore pending builds for deactived build configs
322 if not config.active: 324 if not (config and config.active):
323 self.log.info('Dropping build of configuration "%s" at ' 325 self.log.info('Dropping build of configuration "%s" at '
324 'revision [%s] on %s because the configuration is ' 326 'revision [%s] on %s because the configuration is '
325 'deactivated', config.name, build.rev, platform_name) 327 'deactivated', config_name, build.rev, platform_name)
326 return True 328 return True
327 329
328 # Stay within the revision limits of the build config 330 # Stay within the revision limits of the build config
329 if (config.min_rev and repos.rev_older_than(build.rev, 331 if (config.min_rev and repos.rev_older_than(build.rev,
330 config.min_rev)) \ 332 config.min_rev)) \
Copyright (C) 2012-2017 Edgewall Software