ctlmgr: ignore controllers without a "command" field

Allow controllers to be specified without a "command" field. The user takes
responsibility for ensuring the controller is running: the controller manager
does not attempt to ping the controller. This is useful when one has a common
controller shared between several masters.
This commit is contained in:
Chris Ballance 2019-02-02 16:34:38 +00:00 committed by David Nadlinger
parent 0ebff04ad7
commit eaa1b44b00

View File

@ -180,7 +180,8 @@ class Controllers:
def __setitem__(self, k, v):
try:
if (isinstance(v, dict) and v["type"] == "controller" and
self.host_filter in get_ip_addresses(v["host"])):
self.host_filter in get_ip_addresses(v["host"]) and
"command" in v):
v["command"] = v["command"].format(name=k,
bind=self.host_filter,
port=v["port"])