Skip to content

Commit 92fc8c5

Browse files
authored
Fixing registration metadata (#160)
* Update registration.py * fix lint
1 parent 67cb3ff commit 92fc8c5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/agentex/lib/utils/registration.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ def get_auth_principal(env_vars: EnvironmentVariables):
2020
except Exception:
2121
return None
2222

23-
def get_build_info(env_vars: EnvironmentVariables):
24-
logger.info(f"Getting build info from {env_vars.BUILD_INFO_PATH}")
25-
if not env_vars.BUILD_INFO_PATH:
23+
def get_build_info():
24+
build_info_path = os.environ.get("BUILD_INFO_PATH")
25+
logger.info(f"Getting build info from {build_info_path}")
26+
if not build_info_path:
2627
return None
2728
try:
28-
with open(env_vars.BUILD_INFO_PATH, "r") as f:
29+
with open(build_info_path, "r") as f:
2930
return json.load(f)
3031
except Exception:
3132
return None
@@ -50,7 +51,7 @@ async def register_agent(env_vars: EnvironmentVariables):
5051
"acp_url": full_acp_url,
5152
"acp_type": env_vars.ACP_TYPE,
5253
"principal_context": get_auth_principal(env_vars),
53-
"registration_metadata": get_build_info(env_vars)
54+
"registration_metadata": get_build_info()
5455
}
5556

5657
if env_vars.AGENT_ID:

0 commit comments

Comments
 (0)