Changeset 252 for trunk/web


Ignore:
Timestamp:
Dec 11, 2007, 2:23:21 AM (17 years ago)
Author:
ecprice
Message:

Allow fully qualified domains in the NICs table to override the
name.servers.csail.mit.edu domains.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/main.py

    r248 r252  
    275275    return templates.vnc(searchList=[d])
    276276
     277def getHostname(nic):
     278    if nic.hostname and '.' in nic.hostname:
     279        return nic.hostname
     280    elif nic.machine:
     281        return nic.machine.name + '.servers.csail.mit.edu'
     282    else:
     283        return None
     284
     285
    277286def getNicInfo(data_dict, machine):
    278287    """Helper function for info, get data on nics for a machine.
     
    290299        nic_fields.extend([(x % i, y % i) for x, y in nic_fields_template])
    291300        if not i:
    292             data_dict['nic%s_hostname' % i] = (machine.name +
    293                                                '.servers.csail.mit.edu')
     301            data_dict['nic%s_hostname' % i] = getHostname(machine.nics[i])
    294302        data_dict['nic%s_mac' % i] = machine.nics[i].mac_addr
    295303        data_dict['nic%s_ip' % i] = machine.nics[i].ip
Note: See TracChangeset for help on using the changeset viewer.