7 |
|
|
8 |
def get_local_hostname(): |
def get_local_hostname(): |
9 |
# |
# |
10 |
|
# See if there is a FIGdisk/config/hostname file. If there |
11 |
|
# is, force the hostname to be that. |
12 |
|
# |
13 |
|
|
14 |
|
try: |
15 |
|
fh = open(os.path.join(FIG_Config.fig_disk, "config", "hostname")) |
16 |
|
host = fh.readline() |
17 |
|
return host.strip() |
18 |
|
except: |
19 |
|
pass |
20 |
|
|
21 |
|
# |
22 |
# First check to see if we our hostname is correct. |
# First check to see if we our hostname is correct. |
23 |
# |
# |
24 |
# Map it to an IP address, and try to bind to that ip. |
# Map it to an IP address, and try to bind to that ip. |