Revision e7323b5e lib/daemon.py
b/lib/daemon.py | ||
---|---|---|
40 | 40 |
from ganeti import constants |
41 | 41 |
from ganeti import errors |
42 | 42 |
from ganeti import netutils |
43 |
from ganeti import ssconf |
|
43 | 44 |
|
44 | 45 |
|
45 | 46 |
_DEFAULT_RUN_USER = "root" |
... | ... | |
542 | 543 |
|
543 | 544 |
if daemon_name in constants.DAEMONS_PORTS: |
544 | 545 |
default_bind_address = constants.IP4_ADDRESS_ANY |
546 |
try: |
|
547 |
family = ssconf.SimpleStore().GetPrimaryIPFamily() |
|
548 |
if family == netutils.IP6Address.family: |
|
549 |
default_bind_address = constants.IP6_ADDRESS_ANY |
|
550 |
except errors.ConfigurationError: |
|
551 |
# This case occurs when adding a node, as there is no ssconf available |
|
552 |
# when noded is first started. In that case, however, the correct |
|
553 |
# bind_address must be passed |
|
554 |
pass |
|
555 |
|
|
545 | 556 |
default_port = netutils.GetDaemonPort(daemon_name) |
546 | 557 |
|
547 | 558 |
# For networked daemons we allow choosing the port and bind address |
... | ... | |
549 | 560 |
help="Network port (default: %s)" % default_port, |
550 | 561 |
default=default_port, type="int") |
551 | 562 |
optionparser.add_option("-b", "--bind", dest="bind_address", |
552 |
help=("Bind address (default: %s)" %
|
|
563 |
help=("Bind address (default: '%s')" %
|
|
553 | 564 |
default_bind_address), |
554 | 565 |
default=default_bind_address, metavar="ADDRESS") |
555 | 566 |
|
Also available in: Unified diff