summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorMark Washenberger <mark.washenberger@rackspace.com>2011-05-17 11:41:58 -0400
committerMark Washenberger <mark.washenberger@rackspace.com>2011-05-17 11:41:58 -0400
commit272519ccebc15096c6f93f6aad6e8e8a188ee533 (patch)
tree3d72dc369234d1d65700a6c916422c9d002b87c4 /nova/utils.py
parentb00d39083901731a4345c0a0b13ce98f1dfaaf01 (diff)
parent0946bac5fa210dc9172bbd6ab73ffd77495ebe58 (diff)
merge lp:nova
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py22
1 files changed, 2 insertions, 20 deletions
diff --git a/nova/utils.py b/nova/utils.py
index b55e83e5a..361fc9873 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -306,26 +306,6 @@ def get_my_linklocal(interface):
" :%(ex)s") % locals())
-def to_global_ipv6(prefix, mac):
- try:
- mac64 = netaddr.EUI(mac).eui64().words
- int_addr = int(''.join(['%02x' % i for i in mac64]), 16)
- mac64_addr = netaddr.IPAddress(int_addr)
- maskIP = netaddr.IPNetwork(prefix).ip
- return (mac64_addr ^ netaddr.IPAddress('::0200:0:0:0') | maskIP).\
- format()
- except TypeError:
- raise TypeError(_('Bad mac for to_global_ipv6: %s') % mac)
-
-
-def to_mac(ipv6_address):
- address = netaddr.IPAddress(ipv6_address)
- mask1 = netaddr.IPAddress('::ffff:ffff:ffff:ffff')
- mask2 = netaddr.IPAddress('::0200:0:0:0')
- mac64 = netaddr.EUI(int(address & mask1 ^ mask2)).words
- return ':'.join(['%02x' % i for i in mac64[0:3] + mac64[5:8]])
-
-
def utcnow():
"""Overridable version of datetime.datetime.utcnow."""
if utcnow.override_time:
@@ -462,6 +442,8 @@ class LoopingCall(object):
try:
while self._running:
self.f(*self.args, **self.kw)
+ if not self._running:
+ break
greenthread.sleep(interval)
except LoopingCallDone, e:
self.stop()