summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-03-03 16:12:55 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-03-03 16:12:55 -0500
commit23c0ef3a70afd684ae0dce8c9514d96749494b06 (patch)
tree142f7afe40340b3bb842c5b3e15be07e403cb3b2 /scripts
parent2b76989e4b5ee6206dd676d4f7600be0838e1fcb (diff)
downloadthird_party-cobbler-23c0ef3a70afd684ae0dce8c9514d96749494b06.tar.gz
third_party-cobbler-23c0ef3a70afd684ae0dce8c9514d96749494b06.tar.xz
third_party-cobbler-23c0ef3a70afd684ae0dce8c9514d96749494b06.zip
Fix findks script to match new API
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/findks.cgi8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/findks.cgi b/scripts/findks.cgi
index 70b9870..6fad6dc 100755
--- a/scripts/findks.cgi
+++ b/scripts/findks.cgi
@@ -70,7 +70,13 @@ def autodetect():
devicepair = os.environ["HTTP_X_RHN_PROVISIONING_MAC_0"]
mac = devicepair.split()[1].strip()
# mac is the macaddress of the first nic reported by anaconda
- candidates = [system['name'] for system in systems if system['mac_address'].lower() == mac.lower()]
+
+ candidates = []
+ for x in systems:
+ for y in x["interfaces"]:
+ if x["interfaces"][y]["ip_address"] == ip:
+ candidates.append(x)
+
if len(candidates) == 0:
print "# no system entries with MAC %s found" % mac
print "# trying IP lookup"