[mirrorbrain-commits] r8343 - /trunk/mb/mb.py

From: <poeml_at_mirrorbrain.org>
Date: Mon, 27 Jan 2014 21:30:36 -0000
Author: poeml
Date: Mon Jan 27 22:30:36 2014
New Revision: 8343

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8343&view=rev
Log:
mb update:
- handle errors that lead to Null prefix or Null ASN, so the command doesn't
  crash. (issue #137)

Modified:
    trunk/mb/mb.py

Modified: trunk/mb/mb.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb.py?rev=8343&r1=8342&r2=8343&view=diff
==============================================================================
--- trunk/mb/mb.py	(original)
+++ trunk/mb/mb.py	Mon Jan 27 22:30:36 2014
_at_@ -439,13 +439,19 @@
                         mirror.ipv6Only = res.ipv6Only()
 
             if opts.prefix and res:
-                if mirror.prefix != res.prefix:
+                if not res.prefix:
+                    print '%s: STRANGE! There\'s no prefix containing this hosts IP address (%s)...' \
+                            % (mirror.identifier, res.ip)
+                elif mirror.prefix != res.prefix:
                     print '%s: updating network prefix (%s -> %s)' \
                         % (mirror.identifier, mirror.prefix, res.prefix)
                     if not opts.dry_run:
                         mirror.prefix = res.prefix
             if opts.asn and res:
-                if mirror.asn != res.asn:
+                if not res.asn:
+                    print '%s: STRANGE! There\'s no ASN containing this hosts IP address (%s)...' \
+                            % (mirror.identifier, res.ip)
+                elif mirror.asn != res.asn:
                     print '%s: updating autonomous system number (%s -> %s)' \
                         % (mirror.identifier, mirror.asn, res.asn)
                     if not opts.dry_run:




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Mon Jan 27 2014 - 21:30:38 GMT

This archive was generated by hypermail 2.3.0 : Mon Jan 27 2014 - 21:32:04 GMT