diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-01-09 18:08:54 -0800 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-01-09 18:08:54 -0800 |
| commit | 3b4582b5db905a6dcadda31be27c9f340d7fe5cf (patch) | |
| tree | 7aef8537954fcfbbfd9bb10da98959bec314de60 /nova/utils.py | |
| parent | b4ca59a68ff4a6af2967b8342b9240f0092f27a4 (diff) | |
| download | nova-3b4582b5db905a6dcadda31be27c9f340d7fe5cf.tar.gz nova-3b4582b5db905a6dcadda31be27c9f340d7fe5cf.tar.xz nova-3b4582b5db905a6dcadda31be27c9f340d7fe5cf.zip | |
Moved get_my_ip into flags because that is the only thing it is being used for and use it to set a new flag called my_ip
Diffstat (limited to 'nova/utils.py')
| -rw-r--r-- | nova/utils.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/nova/utils.py b/nova/utils.py index cc632b835..aadbec532 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -195,19 +195,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: - LOG.warn(_("Couldn't get IP, using 127.0.0.1 %s"), ex) - return "127.0.0.1" - - def utcnow(): """Overridable version of datetime.datetime.utcnow.""" if utcnow.override_time: |
