Changeset 252
- Timestamp:
- Dec 11, 2007, 2:23:21 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dhcp/dhcpserver.py
r230 r252 110 110 if ip is None: #Deactivated? 111 111 return False 112 hostname = nic.machine.name 113 if hostname is not None: 114 hostname += ".servers.csail.mit.edu" 112 if nic.hostname and '.' in nic.hostname: 113 hostname = nic.hostname 114 elif nic.machine.name: 115 hostname = nic.machine.name + '.servers.csail.mit.edu' 116 else: 117 hostname = None 115 118 if ip is not None: 116 119 ip = ipv4(ip) -
trunk/web/main.py
r248 r252 275 275 return templates.vnc(searchList=[d]) 276 276 277 def 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 277 286 def getNicInfo(data_dict, machine): 278 287 """Helper function for info, get data on nics for a machine. … … 290 299 nic_fields.extend([(x % i, y % i) for x, y in nic_fields_template]) 291 300 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]) 294 302 data_dict['nic%s_mac' % i] = machine.nics[i].mac_addr 295 303 data_dict['nic%s_ip' % i] = machine.nics[i].ip
Note: See TracChangeset
for help on using the changeset viewer.