From f8f79ecf99d7b33c74ec362321da289dc193efe3 Mon Sep 17 00:00:00 2001 From: Scott Kitterman Date: Mon, 31 Jan 2011 18:37:23 -0500 Subject: [PATCH] * Update requestsync to send to Launchpad's MX record instead of hard coding to the old MX (fiordland) * Recommend python-dns --- debian/changelog | 8 +++++++- debian/control | 3 ++- requestsync | 19 +++++++++++++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 44a6d2a..35f4ce7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,14 @@ ubuntu-dev-tools (0.115) UNRELEASED; urgency=low + [ Stefano Rivera ] * Catch DownloadErrors in ubuntutools.archive users. (LP: #708862) - -- Stefano Rivera Mon, 31 Jan 2011 18:54:28 +0200 + [ Scott Kitterman ] + * Update requestsync to send to Launchpad's MX record instead of hard + coding to the old MX (fiordland) + * Recommend python-dns + + -- Scott Kitterman Mon, 31 Jan 2011 17:23:20 -0500 ubuntu-dev-tools (0.114) unstable; urgency=low diff --git a/debian/control b/debian/control index 0b18542..b9b3bfd 100644 --- a/debian/control +++ b/debian/control @@ -55,7 +55,8 @@ Recommends: bzr, python-gnupginterface, python-magic, python-soappy, - reportbug (>= 3.39ubuntu1) + reportbug (>= 3.39ubuntu1), + python-dns Suggests: debian-keyring, python-simplejson | python (>= 2.7), qemu-kvm-extras-static diff --git a/requestsync b/requestsync index 0f8872f..6b7c499 100755 --- a/requestsync +++ b/requestsync @@ -95,9 +95,24 @@ def main(): boolean=True) if options.lpinstance is None: options.lpinstance = config.get_value('LPINSTANCE') + + mailserver_host = config.get_value('SMTP_SERVER', - default='fiordland.ubuntu.com', - compat_keys=['UBUSMTP', 'DEBSMTP']) + default='', + compat_keys=['UBUSMTP', 'DEBSMTP']) + if not mailserver_host: + try: + import DNS + DNS.DiscoverNameServers() + mxlist = DNS.mxlookup('launchpad.net') + firstmx = mxlist[0] + mx1host = firstmx[1] + mailserver_host = config.get_value('SMTP_SERVER', + default=mx1host, + compat_keys=['UBUSMTP', 'DEBSMTP']) + except ImportError, x: + print "Please install python-dns to support Launchapd mail server lookup." + mailserver_port = config.get_value('SMTP_PORT', default=25, compat_keys=['UBUSMTP_PORT', 'DEBSMTP_PORT'])