Revision 89e1fc26 lib/config.py
b/lib/config.py | ||
---|---|---|
35 | 35 |
""" |
36 | 36 |
|
37 | 37 |
import os |
38 |
import socket |
|
39 | 38 |
import tempfile |
40 | 39 |
import random |
41 | 40 |
|
... | ... | |
78 | 77 |
else: |
79 | 78 |
self._cfg_file = cfg_file |
80 | 79 |
self._temporary_ids = set() |
80 |
# Note: in order to prevent errors when resolving our name in |
|
81 |
# _DistributeConfig, we compute it here once and reuse it; it's |
|
82 |
# better to raise an error before starting to modify the config |
|
83 |
# file than after it was modified |
|
84 |
self._my_hostname = utils.HostInfo().name |
|
81 | 85 |
|
82 | 86 |
# this method needs to be static, so that we can call it on the class |
83 | 87 |
@staticmethod |
... | ... | |
527 | 531 |
return True |
528 | 532 |
bad = False |
529 | 533 |
nodelist = self.GetNodeList() |
530 |
myhostname = socket.gethostname()
|
|
534 |
myhostname = self._my_hostname
|
|
531 | 535 |
|
532 | 536 |
tgt_list = [] |
533 | 537 |
for node in nodelist: |
Also available in: Unified diff