From 002df25b7c2f356dac6f3f2d9a16b787c64fd2ce Mon Sep 17 00:00:00 2001 From: Guancheng Fu <110874468+gc-fu@users.noreply.github.com> Date: Fri, 26 Aug 2022 23:14:13 +0800 Subject: [PATCH] [PPML] Refine get RABIT_TRACKER_IP env in XGBoost examples (#5528) * The original code will lead to keyError if "RABIT_TRACKER_IP" is not set. The ideal result should be return None. --- ppml/trusted-big-data-ml/python/docker-graphene/tracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppml/trusted-big-data-ml/python/docker-graphene/tracker.py b/ppml/trusted-big-data-ml/python/docker-graphene/tracker.py index fdc436c5b11..e2ead8b13c2 100644 --- a/ppml/trusted-big-data-ml/python/docker-graphene/tracker.py +++ b/ppml/trusted-big-data-ml/python/docker-graphene/tracker.py @@ -455,7 +455,7 @@ def start_rabit_tracker(args): def main(): """Main function if tracker is executed in standalone mode.""" - host_ip = os.environ['RABIT_TRACKER_IP'] + host_ip = os.environ.get("RABIT_TRACKER_IP") if host_ip == None: sys.stdout.write("###PYTHONWARN### RABIT_TRACKER_IP not set in env")