~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/devscripts/ec2test/remote.py

  • Committer: Jonathan Lange
  • Date: 2010-08-17 10:07:33 UTC
  • mto: This revision was merged to the branch mainline in revision 11390.
  • Revision ID: jml@canonical.com-20100817100733-fs8fovlk39n6adns
Extract email sending code so we can patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
299
299
        self._emails = emails
300
300
        self._pqm_message = pqm_message
301
301
 
 
302
    def _send_email(self, config, message):
 
303
        """Actually send 'message'."""
 
304
        conn = bzrlib.smtp_connection.SMTPConnection(config)
 
305
        conn.send_email(message)
 
306
 
302
307
    def get_trunk_details(self):
303
308
        """Return (branch_url, revno) for trunk."""
304
309
        branch = bzrlib.branch.Branch.open_containing(
380
385
            filename='%s.log.gz' % self.get_nick())
381
386
        message.attach(zipped_log)
382
387
 
383
 
        bzrlib.smtp_connection.SMTPConnection(config).send_email(message)
 
388
        self._send_email(message)
384
389
 
385
390
    def iter_dependency_branches(self):
386
391
        """Iterate through the Bazaar branches we depend on."""
399
404
            return
400
405
        subject = self._pqm_message.get('Subject')
401
406
        if successful:
402
 
            conn = bzrlib.smtp_connection.SMTPConnection(config)
403
 
            conn.send_email(self._pqm_message)
 
407
            self._send_email(self._pqm_message)
404
408
        return subject
405
409
 
406
410
    @property