diff options
| author | andy <github@anarkystic.com> | 2010-06-11 10:08:13 +0100 |
|---|---|---|
| committer | andy <github@anarkystic.com> | 2010-06-11 10:08:13 +0100 |
| commit | 716673f9bb09a61aa0136aeac0c6ca5b3d91d141 (patch) | |
| tree | cd7a8bdbf42cfea46d30918aeb4b831cbd492716 | |
| parent | b07af87974052abcbb12c0531b22fe9be416a498 (diff) | |
| download | nova-716673f9bb09a61aa0136aeac0c6ca5b3d91d141.tar.gz nova-716673f9bb09a61aa0136aeac0c6ca5b3d91d141.tar.xz nova-716673f9bb09a61aa0136aeac0c6ca5b3d91d141.zip | |
make get_my_ip return 127.0.0.1 for testing
| -rw-r--r-- | nova/utils.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py index 6f0d84800..4acd23101 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -102,6 +102,8 @@ def last_octet(address): def get_my_ip(): ''' returns the actual ip of the local machine. ''' + if getattr(FLAGS, 'fake_tests', None): + return '127.0.0.1' csock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) csock.connect(('www.google.com', 80)) (addr, port) = csock.getsockname() |
