Skip to content

Commit

Permalink
fix ip funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
ripper234 committed Mar 17, 2011
1 parent 427fb18 commit f7782f7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 48 deletions.
60 changes: 14 additions & 46 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 = instance.ip_address
instanceIp = str(instance.ip_address)
print "IP for {} resolved as {}".format(instance.dns_name, instanceIp)
if instanceIp == ip:
return instance
Expand Down
3 changes: 2 additions & 1 deletion backup/src/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import socket
import datetime
import time
import re
from urllib import urlopen


Expand Down Expand Up @@ -36,4 +37,4 @@ def get_current_utc_time():

def resolveIp(target):
ip = repr(socket.gethostbyname_ex(target)[2][0])
return ip
return re.search("'(.*)'", ip).group(1)

0 comments on commit f7782f7

Please sign in to comment.