From f7782f744b77bf735d41f43e99535835dac9446e Mon Sep 17 00:00:00 2001 From: ripper234 Date: Thu, 17 Mar 2011 16:13:53 +0200 Subject: [PATCH] fix ip funcs --- .idea/workspace.xml | 60 +++++++++++--------------------------------- backup/src/backup.py | 2 +- backup/src/utils.py | 3 ++- 3 files changed, 17 insertions(+), 48 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0b2657b..02308be 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,8 @@ - + @@ -29,7 +29,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -58,9 +58,9 @@ @@ -112,38 +112,6 @@ - + - + - + - + - + - + - + diff --git a/backup/src/backup.py b/backup/src/backup.py index 6ef5d68..d768a6e 100644 --- a/backup/src/backup.py +++ b/backup/src/backup.py @@ -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 diff --git a/backup/src/utils.py b/backup/src/utils.py index a0660c8..6b1a415 100644 --- a/backup/src/utils.py +++ b/backup/src/utils.py @@ -1,6 +1,7 @@ import socket import datetime import time +import re from urllib import urlopen @@ -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)