Skip to content

Commit

Permalink
fix internal ip
Browse files Browse the repository at this point in the history
  • Loading branch information
draw3cards committed Mar 17, 2011
1 parent 421917e commit 427fb18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backup/src/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def find_target(target, reservations) :
print "Skipping reservation " + reservation
continue
instance = instances[0]
instanceIp = resolveIp(instance.dns_name)
instanceIp = instance.ip_address
print "IP for {} resolved as {}".format(instance.dns_name, instanceIp)
if instanceIp == ip:
return instance
Expand Down
6 changes: 6 additions & 0 deletions backup/src/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import socket
import datetime
import time
from urllib import urlopen


def single_or_none(list):
if len(list) != 1:
Expand All @@ -16,6 +18,10 @@ def single(list):
return result


def get_my_ip():
return urlopen('http://whatismyip.com/automation/n09230945.asp').read()


def get_time(dt_str):
# http://stackoverflow.com/questions/127803/how-to-parse-iso-formatted-date-in-python/127825#127825
dt, _, us= dt_str.partition(".")
Expand Down

0 comments on commit 427fb18

Please sign in to comment.