From bc8f373c82133cdaf4731a869faa1483f9c6627f Mon Sep 17 00:00:00 2001 From: Ayush Bansal Date: Sun, 7 Feb 2021 11:22:12 +0530 Subject: [PATCH] Use of get_host_url method to remove unnecessary code --- evalai/set_host.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/evalai/set_host.py b/evalai/set_host.py index 8daa4265d..0ef8c337d 100644 --- a/evalai/set_host.py +++ b/evalai/set_host.py @@ -5,6 +5,7 @@ from click import echo, style from evalai.utils.config import AUTH_TOKEN_DIR, HOST_URL_FILE_PATH +from evalai.utils.auth import get_host_url @click.group(invoke_without_command=True) @@ -48,14 +49,8 @@ def host(set_host): ) ) else: - with open(HOST_URL_FILE_PATH, "r") as fr: - try: - data = fr.read() - echo( - style( - "{} is the Host URL of EvalAI.".format(data), - bold=True, - ) - ) - except (OSError, IOError) as e: - echo(e) + echo( + style( + "{} is the Host URL of EvalAI.".format(get_host_url()) + ) + )