# HG changeset patch # User osimons # Date 1274430422 0 # Node ID 4de39c41d4891e475e10344ecb74beea991137bb # Parent 7eaece84fe85a60b5afa965c60415df74217aaad Merged [876] from trunk. diff --git a/bitten/main.py b/bitten/main.py --- 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)