From 23c0ef3a70afd684ae0dce8c9514d96749494b06 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Mon, 3 Mar 2008 16:12:55 -0500 Subject: Fix findks script to match new API --- scripts/findks.cgi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') 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" -- cgit