~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/model/queue.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-06 07:15:43 UTC
  • mfrom: (14634.1.6 bug-876594)
  • Revision ID: launchpad@pqm.canonical.com-20120106071543-ym23hw45nfuskgre
[r=jcsackett][bug=876594] Don't notify upstream authors of build
 failures of synced sources.

Show diffs side-by-side

added added

removed removed

Lines of Context:
845
845
        # and uploading to any archive as the signer.
846
846
        return changes, strip_pgp_signature(changes_content).splitlines(True)
847
847
 
 
848
    def findSourcePublication(self):
 
849
        """Find the `SourcePackagePublishingHistory` for this build."""
 
850
        first_build = self.builds[:1]
 
851
        if first_build:
 
852
            [first_build] = first_build
 
853
            return first_build.build._getLatestPublication()
 
854
        else:
 
855
            return None
 
856
 
 
857
    def findPersonToNotify(self):
 
858
        """Find the right person to notify about this upload."""
 
859
        spph = self.findSourcePublication()
 
860
        if spph and self.sourcepackagerelease.upload_archive != self.archive:
 
861
            # This is a build triggered by the syncing of a source
 
862
            # package.  Notify the person who requested the sync.
 
863
            return spph.creator
 
864
        elif self.signing_key:
 
865
            return self.signing_key.owner
 
866
        else:
 
867
            return None
 
868
 
848
869
    def notify(self, summary_text=None, changes_file_object=None,
849
870
               logger=None, dry_run=False):
850
871
        """See `IPackageUpload`."""
860
881
            changesfile_content = changes_file_object.read()
861
882
        else:
862
883
            changesfile_content = 'No changes file content available.'
863
 
        if self.signing_key is not None:
864
 
            signer = self.signing_key.owner
865
 
        else:
866
 
            signer = None
 
884
        blamee = self.findPersonToNotify()
867
885
        notify(
868
 
            signer, self.sourcepackagerelease, self.builds, self.customfiles,
 
886
            blamee, self.sourcepackagerelease, self.builds, self.customfiles,
869
887
            self.archive, self.distroseries, self.pocket, summary_text,
870
888
            changes, changesfile_content, changes_file_object,
871
889
            status_action[self.status], dry_run=dry_run, logger=logger)