changeset 799:4de39c41d489 0.6.x

Merged [876] from trunk.
author osimons
date Fri, 21 May 2010 08:27:02 +0000
parents 7eaece84fe85
children 9ea955165b48
files bitten/main.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/main.py
+++ b/bitten/main.py
@@ -152,6 +152,16 @@
         self.log.error("Unknown build/config resource.id: %s" % resource.id)
         return 'Unknown Build or Config'
 
+    def resource_exists(self, resource):
+        config_name, build_id = self._parse_resource(resource.id)
+        if build_id:
+            build = Build.fetch(self.env, build_id)
+            return build and build.exists or False
+        elif config_name:
+            config = BuildConfig.fetch(self.env, config_name)
+            return config and config.exists or False
+        return False
+
     def _parse_resource(self, resource_id):
         """ Returns a (config_name, build_id) tuple. """
         r = resource_id.split('/', 1)
Copyright (C) 2012-2017 Edgewall Software