summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-02-12 13:18:49 -0500
committerRussell Bryant <rbryant@redhat.com>2012-02-12 13:18:49 -0500
commite023c28a81a2b43786d60dacf9d324537ee2dfd0 (patch)
treed8deb4ce5a29addbdf11bf3fed73853d79e6e621
parentd8f8bad0f26b4438986ab1a469d89d03b22551db (diff)
downloadnova-e023c28a81a2b43786d60dacf9d324537ee2dfd0.tar.gz
nova-e023c28a81a2b43786d60dacf9d324537ee2dfd0.tar.xz
nova-e023c28a81a2b43786d60dacf9d324537ee2dfd0.zip
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
-rw-r--r--nova/flags.py9
1 files changed, 8 insertions, 1 deletions
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))