diff options
-rw-r--r-- | nova/network/linux_net.py | 14 | ||||
-rw-r--r-- | nova/tests/test_api.py | 1 | ||||
-rw-r--r-- | nova/utils.py | 17 |
3 files changed, 9 insertions, 23 deletions
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py index 50256db2d..677931603 100644 --- a/nova/network/linux_net.py +++ b/nova/network/linux_net.py @@ -292,12 +292,12 @@ interface %s """ % (network_ref['bridge'], network_ref['cidr_v6']) f.write(conf_str) - # Make sure dnsmasq can actually read it (it setuid()s to "nobody") + # Make sure radvd can actually read it (it setuid()s to "nobody") os.chmod(conffile, 0644) pid = _ra_pid_for(network_ref['bridge']) - # if dnsmasq is already running, then tell it to reload + # if radvd is already running, then tell it to reload if pid: out, _err = _execute('cat /proc/%d/cmdline' % pid, check_exit_code=False) @@ -306,9 +306,9 @@ interface %s _execute('sudo kill -HUP %d' % pid) return except Exception as exc: # pylint: disable-msg=W0703 - logging.debug("Hupping radvd threw %s", exc) + LOG.debug(_("Hupping radvd threw %s"), exc) else: - logging.debug("Pid %d is stale, relaunching radvd", pid) + LOG.debug(_("Pid %d is stale, relaunching radvd"), pid) command = _ra_cmd(network_ref) _execute(command) db.network_update(context, network_id, @@ -378,7 +378,7 @@ def _dnsmasq_cmd(net): def _ra_cmd(net): - """Builds dnsmasq command""" + """Builds radvd command""" cmd = ['sudo -E radvd', # ' -u nobody', ' -C %s' % _ra_file(net['bridge'], 'conf'), @@ -408,7 +408,7 @@ def _dhcp_file(bridge, kind): def _ra_file(bridge, kind): - """Return path to a pid, leases or conf file for a bridge""" + """Return path to a pid or conf file for a bridge""" if not os.path.exists(FLAGS.networks_path): os.makedirs(FLAGS.networks_path) @@ -433,7 +433,7 @@ def _dnsmasq_pid_for(bridge): def _ra_pid_for(bridge): - """Returns the pid for prior dnsmasq instance for a bridge + """Returns the pid for prior radvd instance for a bridge Returns None if no pid file exists diff --git a/nova/tests/test_api.py b/nova/tests/test_api.py index a508235c4..d22d7beb1 100644 --- a/nova/tests/test_api.py +++ b/nova/tests/test_api.py @@ -24,7 +24,6 @@ import httplib import random import StringIO import webob -import logging from nova import context from nova import flags diff --git a/nova/utils.py b/nova/utils.py index 09c9a5f89..27589c30c 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -202,19 +202,6 @@ def last_octet(address): return int(address.split(".")[-1]) -def get_my_ip(): - """Returns the actual ip of the local machine.""" - try: - csock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - csock.connect(('8.8.8.8', 80)) - (addr, port) = csock.getsockname() - csock.close() - return addr - except socket.gaierror as ex: - logging.warn(_("Couldn't get IP, using 127.0.0.1 %s"), ex) - return "127.0.0.1" - - def get_my_linklocal(interface): try: if_str = execute("ip -f inet6 -o addr show %s" % interface) @@ -226,9 +213,9 @@ def get_my_linklocal(interface): else: return 'fe00::' except IndexError as ex: - logging.warn(_("Couldn't get Link Local IP of %s :%s"), interface, ex) + LOG.warn(_("Couldn't get Link Local IP of %s :%s"), interface, ex) except ProcessExecutionError as ex: - logging.warn(_("Couldn't get Link Local IP of %s :%s"), interface, ex) + LOG.warn(_("Couldn't get Link Local IP of %s :%s"), interface, ex) except: return 'fe00::' |