Use a singular configured cluster by default
If there is... 1. No '--cluster' passed, and 2. No 'local' cluster, and 3. There is exactly one cluster configured ...then use that cluster by default in the CLI.
This commit is contained in:
parent
ea709f573f
commit
53aed0a735
|
@ -5741,6 +5741,11 @@ def cli(_cluster, _debug, _quiet, _unsafe, _colour):
|
|||
global config
|
||||
store_data = get_store(store_path)
|
||||
config = get_config(store_data, _cluster)
|
||||
|
||||
# There is only one cluster and no local cluster, so even if nothing was passed, use it
|
||||
if len(store_data) == 1 and _cluster is None and config.get("badcfg", None):
|
||||
config = get_config(store_data, list(store_data.keys())[0])
|
||||
|
||||
if not config.get("badcfg", None):
|
||||
config["debug"] = _debug
|
||||
config["unsafe"] = _unsafe
|
||||
|
|
Loading…
Reference in New Issue