From e023c28a81a2b43786d60dacf9d324537ee2dfd0 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Sun, 12 Feb 2012 13:18:49 -0500 Subject: Add some more comments to _get_my_ip(). bug 930513. This patch adds some additional comments to _get_my_ip() to try to make the code a bit more clear and to clarify that no traffic is actually sent out by this code. Change-Id: I6f8d4a0a51596e5c531da53f3c79c5bffca59b39 --- nova/flags.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nova/flags.py b/nova/flags.py index 6fc3100f8..e385c114f 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -59,7 +59,14 @@ def DECLARE(name, module_string, flag_values=FLAGS): def _get_my_ip(): - """Returns the actual ip of the local machine.""" + """ + Returns the actual ip of the local machine. + + This code figures out what source address would be used if some traffic + were to be sent out to some well known address on the Internet. In this + case, a Google DNS server is used, but the specific address does not + matter much. No traffic is actually sent. + """ try: csock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) csock.connect(('8.8.8.8', 80)) -- cgit