Skip to content

Commit

Permalink
Read studio hostname from config when not present on cli or env (#10459)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgegeddes authored Jun 15, 2024
1 parent 93c3100 commit 676645b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dvc/commands/studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ def run(self):
from dvc.utils.studio import STUDIO_URL
from dvc_studio_client.auth import StudioAuthError, get_access_token

studio = self.config.get("studio", {})
name = self.args.name
hostname = self.args.hostname or os.environ.get(DVC_STUDIO_URL) or STUDIO_URL
hostname = (
self.args.hostname
or os.environ.get(DVC_STUDIO_URL)
or studio.get("url")
or STUDIO_URL
)
scopes = self.args.scopes

studio = self.config.get("studio", {})
if studio.get("url", hostname) == hostname and "token" in studio:
raise DvcException(
"Token already exists. "
Expand Down

0 comments on commit 676645b

Please sign in to comment.