Changeset 227 for trunk/web/templates/main.py
- Timestamp:
- Oct 28, 2007, 11:27:32 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/templates/main.py
r211 r227 259 259 """ 260 260 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'), 262 262 ('nic%s_mac', 'NIC %s MAC Addr'), 263 263 ('nic%s_ip', 'NIC %s IP'), … … 266 266 for i in range(len(machine.nics)): 267 267 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') 270 271 data_dict['nic%s_mac' % i] = machine.nics[i].mac_addr 271 272 data_dict['nic%s_ip' % i] = machine.nics[i].ip … … 329 330 contact = validation.testContact(user, fields.getfirst('contact'), 330 331 machine) 331 hostname = validation.testHostname(owner, fields.getfirst('hostname'),332 machine)333 332 name = validation.testName(user, fields.getfirst('name'), machine) 334 333 oldname = machine.name … … 349 348 ctx.current.save(disk) 350 349 351 # XXX first NIC gets hostname on change?352 # Interface doesn't support more.353 for nic in machine.nics[:1]:354 nic.hostname = hostname355 ctx.current.save(nic)356 357 350 if owner is not None: 358 351 machine.owner = owner … … 513 506 for name in 'machine_id name administrator owner memory contact'.split(): 514 507 setattr(defaults, name, getattr(machine, name)) 515 if machine.nics:516 defaults.hostname = machine.nics[0].hostname517 508 defaults.disk = "%0.2f" % (machine.disks[0].size/1024.) 518 509 d = dict(user=user,
Note: See TracChangeset
for help on using the changeset viewer.