Ignore:
Timestamp:
Oct 28, 2007, 11:27:32 PM (17 years ago)
Author:
ecprice
Message:

Remove the hostname as separate from machine name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/templates/main.py

    r211 r227  
    259259    """
    260260    data_dict['num_nics'] = len(machine.nics)
    261     nic_fields_template = [('nic%s_hostname', 'NIC %s hostname'),
     261    nic_fields_template = [('nic%s_hostname', 'NIC %s Hostname'),
    262262                           ('nic%s_mac', 'NIC %s MAC Addr'),
    263263                           ('nic%s_ip', 'NIC %s IP'),
     
    266266    for i in range(len(machine.nics)):
    267267        nic_fields.extend([(x % i, y % i) for x, y in nic_fields_template])
    268         data_dict['nic%s_hostname' % i] = (machine.nics[i].hostname +
    269                                            '.servers.csail.mit.edu')
     268        if not i:
     269            data_dict['nic%s_hostname' % i] = (machine.name +
     270                                               '.servers.csail.mit.edu')
    270271        data_dict['nic%s_mac' % i] = machine.nics[i].mac_addr
    271272        data_dict['nic%s_ip' % i] = machine.nics[i].ip
     
    329330        contact = validation.testContact(user, fields.getfirst('contact'),
    330331                                         machine)
    331         hostname = validation.testHostname(owner, fields.getfirst('hostname'),
    332                                            machine)
    333332        name = validation.testName(user, fields.getfirst('name'), machine)
    334333        oldname = machine.name
     
    349348                ctx.current.save(disk)
    350349       
    351         # XXX first NIC gets hostname on change? 
    352         # Interface doesn't support more.
    353         for nic in machine.nics[:1]:
    354             nic.hostname = hostname
    355             ctx.current.save(nic)
    356 
    357350        if owner is not None:
    358351            machine.owner = owner
     
    513506    for name in 'machine_id name administrator owner memory contact'.split():
    514507        setattr(defaults, name, getattr(machine, name))
    515     if machine.nics:
    516         defaults.hostname = machine.nics[0].hostname
    517508    defaults.disk = "%0.2f" % (machine.disks[0].size/1024.)
    518509    d = dict(user=user,
Note: See TracChangeset for help on using the changeset viewer.