- Timestamp:
- Jan 12, 2009, 9:27:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-web/code/main.py
r1964 r1976 270 270 XXX this should be merged with the similar logic in DNS and DHCP. 271 271 """ 272 if nic.hostname and '.' in nic.hostname:273 returnnic.hostname272 if nic.hostname: 273 hostname = nic.hostname 274 274 elif nic.machine: 275 return nic.machine.name + '.' + config.dns.domains[0]275 hostname = nic.machine.name 276 276 else: 277 277 return None 278 278 if '.' in hostname: 279 return hostname 280 else: 281 return hostname + '.' + config.dns.domains[0] 279 282 280 283 def getNicInfo(data_dict, machine): … … 292 295 for i in range(len(machine.nics)): 293 296 nic_fields.extend([(x % i, y % i) for x, y in nic_fields_template]) 294 if not i: 295 data_dict['nic%s_hostname' % i] = getHostname(machine.nics[i]) 297 data_dict['nic%s_hostname' % i] = getHostname(machine.nics[i]) 296 298 data_dict['nic%s_mac' % i] = machine.nics[i].mac_addr 297 299 data_dict['nic%s_ip' % i] = machine.nics[i].ip
Note: See TracChangeset
for help on using the changeset viewer.