diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/findks.cgi | 8 |
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" |