Skip to content

Commit

Permalink
default_token() should use get_token()
Browse files Browse the repository at this point in the history
#19

---

Pull Request resolved: #24
commit_hash:0390b8406703bbd3e346abd98d0f8da53ff1acd6
  • Loading branch information
faucct authored and robot-piglet committed Sep 23, 2024
1 parent 67b38d8 commit eb3b7f5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions spyt-package/src/main/python/spyt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from yt.wrapper import YPath # noqa: E402
from yt.wrapper.cypress_commands import list as yt_list, create, exists # noqa: E402
from yt.wrapper.errors import YtHttpResponseError # noqa: E402
from yt.wrapper.http_helpers import get_user_name # noqa: E402
from yt.wrapper.http_helpers import get_user_name, get_token # noqa: E402
from yt.wrapper.operation_commands import get_operation_url # noqa: E402
from yt.yson.convert import yson_to_json # noqa: E402
from .arcadia import checked_extract_spark, checked_extract_spyt # noqa: E402
Expand Down Expand Up @@ -223,13 +223,7 @@ def default_user():


def default_token():
token = os.getenv("YT_TOKEN")
if token is None:
token_file = os.path.join(os.getenv("HOME"), ".yt", "token")
if os.path.exists(token_file):
with open(token_file) as f:
token = f.readline().strip()
return token
return get_token()


def base_spark_conf(client, discovery):
Expand Down

0 comments on commit eb3b7f5

Please sign in to comment.