File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
scaleway-core/scaleway_core/profile Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 11ENV_KEY_SCW_CONFIG_PATH = "SCW_CONFIG_PATH"
2+ ENV_KEY_SCW_PROFILE = "SCW_PROFILE"
23ENV_KEY_SCW_ACCESS_KEY = "SCW_ACCESS_KEY"
34ENV_KEY_SCW_SECRET_KEY = "SCW_SECRET_KEY" # nosec B105
45ENV_KEY_SCW_API_URL = "SCW_API_URL"
Original file line number Diff line number Diff line change 77from typing import Optional , Type , TypeVar
88
99import yaml
10-
1110from scaleway_core import __version__
1211from scaleway_core .profile .file import CONFIG_PROPERTIES_TO_PROFILE
1312
14- from .env import ENV_KEY_SCW_CONFIG_PATH , ENV_VARIABLES_TO_PROFILE
13+ from .env import ENV_KEY_SCW_CONFIG_PATH , ENV_KEY_SCW_PROFILE , ENV_VARIABLES_TO_PROFILE
1514
1615
1716@dataclass
@@ -176,7 +175,7 @@ def from_config_file(
176175 def from_config_file_and_env (
177176 cls : Type [ProfileSelf ],
178177 filepath : Optional [str ] = None ,
179- profile_name : Optional [str ] = "default" ,
178+ profile_name : Optional [str ] = os . environ . get ( ENV_KEY_SCW_PROFILE , "default" ) ,
180179 ) -> ProfileSelf :
181180 """
182181 Loads profile from a config file and environment variables.
You can’t perform that action at this time.
0 commit comments