~0x44/nova/bug838466

« back to all changes in this revision

Viewing changes to nova/ipv6/rfc2462.py

  • Committer: Tarmac
  • Author(s): Ken Pepple
  • Date: 2011-08-24 16:01:48 UTC
  • mfrom: (1468.2.4 lp828614)
  • Revision ID: tarmac-20110824160148-gzsedf8amkw16nq3
add rainy day test to to_global
fixed to_global to catch correct error from incorrect mac addresses

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
        maskIP = netaddr.IPNetwork(prefix).ip
31
31
        return (mac64_addr ^ netaddr.IPAddress('::0200:0:0:0') | maskIP).\
32
32
                                                                format()
 
33
    except netaddr.AddrFormatError:
 
34
        raise TypeError(_('Bad mac for to_global_ipv6: %s') % mac)
33
35
    except TypeError:
34
 
        raise TypeError(_('Bad mac for to_global_ipv6: %s') % mac)
 
36
        raise TypeError(_('Bad prefix for to_global_ipv6: %s') % prefix)
35
37
 
36
38
 
37
39
def to_mac(ipv6_address):