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 1
1
ENV_KEY_SCW_CONFIG_PATH = "SCW_CONFIG_PATH"
2
+ ENV_KEY_SCW_PROFILE = "SCW_PROFILE"
2
3
ENV_KEY_SCW_ACCESS_KEY = "SCW_ACCESS_KEY"
3
4
ENV_KEY_SCW_SECRET_KEY = "SCW_SECRET_KEY" # nosec B105
4
5
ENV_KEY_SCW_API_URL = "SCW_API_URL"
Original file line number Diff line number Diff line change 7
7
from typing import Optional , Type , TypeVar
8
8
9
9
import yaml
10
-
11
10
from scaleway_core import __version__
12
11
from scaleway_core .profile .file import CONFIG_PROPERTIES_TO_PROFILE
13
12
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
15
14
16
15
17
16
@dataclass
@@ -176,7 +175,7 @@ def from_config_file(
176
175
def from_config_file_and_env (
177
176
cls : Type [ProfileSelf ],
178
177
filepath : Optional [str ] = None ,
179
- profile_name : Optional [str ] = "default" ,
178
+ profile_name : Optional [str ] = os . environ . get ( ENV_KEY_SCW_PROFILE , "default" ) ,
180
179
) -> ProfileSelf :
181
180
"""
182
181
Loads profile from a config file and environment variables.
You can’t perform that action at this time.
0 commit comments