diff --git a/buildman/jobutil/buildjob.py b/buildman/jobutil/buildjob.py index 4f3ea5751..ca1d31308 100644 --- a/buildman/jobutil/buildjob.py +++ b/buildman/jobutil/buildjob.py @@ -193,12 +193,13 @@ class BuildJobNotifier(object): def send_notification(self, kind, error_message=None, image_id=None, manifest_digests=None): with UseThenDisconnect(app.config): tags = self.build_config.get('docker_tags', ['latest']) + trigger = self.repo_build.trigger event_data = { 'build_id': self.repo_build.uuid, 'build_name': self.repo_build.display_name, 'docker_tags': tags, - 'trigger_id': self.repo_build.trigger.uuid, - 'trigger_kind': self.repo_build.trigger.service.name, + 'trigger_id': trigger.uuid if trigger is not None else None, + 'trigger_kind': trigger.service.name if trigger is not None else None, 'trigger_metadata': self.build_config.get('trigger_metadata', {}) } diff --git a/util/secscan/api.py b/util/secscan/api.py index fb8c5c0d4..fee1b97aa 100644 --- a/util/secscan/api.py +++ b/util/secscan/api.py @@ -221,8 +221,9 @@ class ImplementedSecurityScannerAPI(SecurityScannerAPIInterface): 'Authorization': auth_header, } - if layer.parent.docker_image_id and layer.parent.storage.uuid: - layer_request['ParentName'] = compute_layer_id(layer.parent) + if layer.parent is not None: + if layer.parent.docker_image_id and layer.parent.storage.uuid: + layer_request['ParentName'] = compute_layer_id(layer.parent) return { 'Layer': layer_request,