diff --git a/agent-node/VERSION b/agent-node/VERSION index 59e9e60..bb83058 100644 --- a/agent-node/VERSION +++ b/agent-node/VERSION @@ -1 +1 @@ -1.0.11 +1.0.12 diff --git a/agent-node/bootstrap_installer.py b/agent-node/bootstrap_installer.py index d1bfde5..a2d5f8e 100644 --- a/agent-node/bootstrap_installer.py +++ b/agent-node/bootstrap_installer.py @@ -218,28 +218,34 @@ args = parser.parse_args() # Try loading existing config for defaults - config_path = "agent_config.yaml" + # Look in CWD first, then in the target install_dir + install_dir = args.install_dir + config_paths = ["agent_config.yaml", os.path.join(install_dir, "agent_config.yaml")] existing_config = {} - if os.path.exists(config_path): - try: - import yaml - with open(config_path) as f: - existing_config = yaml.safe_load(f) or {} - _print(f"Loaded existing config from {config_path}") - except ImportError: - # Resilient fallback for fresh environments: manual parsing + + for config_path in config_paths: + if os.path.exists(config_path): try: + import yaml with open(config_path) as f: - for line in f: - if ":" in line: - k, v = line.split(":", 1) - # Strip quotes/spaces - existing_config[k.strip()] = v.strip().strip('"').strip("'") - _print(f"Loaded existing config (manual parse) from {config_path}") + existing_config = yaml.safe_load(f) or {} + _print(f"Loaded existing config from {config_path}") + break + except ImportError: + # Resilient fallback for fresh environments: manual parsing + try: + with open(config_path) as f: + for line in f: + if ":" in line: + k, v = line.split(":", 1) + # Strip quotes/spaces + existing_config[k.strip()] = v.strip().strip('"').strip("'") + _print(f"Loaded existing config (manual parse) from {config_path}") + break + except Exception: + pass except Exception: pass - except Exception: - pass hub_url = args.hub or existing_config.get("hub_url", DEFAULT_HUB)